ruru 1.0.0 → 2.0.0-0.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/CHANGELOG.md +15 -0
- package/LICENSE.md +20 -0
- package/README.md +114 -0
- package/bundle/ruru.min.js +2 -0
- package/bundle/ruru.min.js.LICENSE.txt +64 -0
- package/dist/bundle.d.ts +7 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +14 -0
- package/dist/bundle.js.map +1 -0
- package/dist/cli-run.d.ts +3 -0
- package/dist/cli-run.d.ts.map +1 -0
- package/dist/cli-run.js +5 -0
- package/dist/cli-run.js.map +1 -0
- package/dist/cli.d.ts +15 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +126 -0
- package/dist/cli.js.map +1 -0
- package/dist/components/Copy.d.ts +6 -0
- package/dist/components/Copy.d.ts.map +1 -0
- package/dist/components/Copy.js +19 -0
- package/dist/components/Copy.js.map +1 -0
- package/dist/components/ErrorPopup.d.ts +6 -0
- package/dist/components/ErrorPopup.d.ts.map +1 -0
- package/dist/components/ErrorPopup.js +19 -0
- package/dist/components/ErrorPopup.js.map +1 -0
- package/dist/components/Explain.d.ts +14 -0
- package/dist/components/Explain.d.ts.map +1 -0
- package/dist/components/Explain.js +96 -0
- package/dist/components/Explain.js.map +1 -0
- package/dist/components/Footer.d.ts +3 -0
- package/dist/components/Footer.d.ts.map +1 -0
- package/dist/components/Footer.js +3 -0
- package/dist/components/Footer.js.map +1 -0
- package/dist/components/Mermaid.d.ts +5 -0
- package/dist/components/Mermaid.d.ts.map +1 -0
- package/dist/components/Mermaid.js +16 -0
- package/dist/components/Mermaid.js.map +1 -0
- package/dist/defaultQuery.d.ts +2 -0
- package/dist/defaultQuery.d.ts.map +1 -0
- package/dist/defaultQuery.js +34 -0
- package/dist/defaultQuery.js.map +1 -0
- package/dist/hooks/useExplain.d.ts +19 -0
- package/dist/hooks/useExplain.d.ts.map +1 -0
- package/dist/hooks/useExplain.js +43 -0
- package/dist/hooks/useExplain.js.map +1 -0
- package/dist/hooks/useFetcher.d.ts +28 -0
- package/dist/hooks/useFetcher.d.ts.map +1 -0
- package/dist/hooks/useFetcher.js +173 -0
- package/dist/hooks/useFetcher.js.map +1 -0
- package/dist/hooks/useGraphQLChangeStream.d.ts +5 -0
- package/dist/hooks/useGraphQLChangeStream.d.ts.map +1 -0
- package/dist/hooks/useGraphQLChangeStream.js +51 -0
- package/dist/hooks/useGraphQLChangeStream.js.map +1 -0
- package/dist/hooks/usePrettify.d.ts +12 -0
- package/dist/hooks/usePrettify.d.ts.map +1 -0
- package/dist/hooks/usePrettify.js +29 -0
- package/dist/hooks/usePrettify.js.map +1 -0
- package/dist/hooks/useSchema.d.ts +8 -0
- package/dist/hooks/useSchema.d.ts.map +1 -0
- package/dist/hooks/useSchema.js +66 -0
- package/dist/hooks/useSchema.js.map +1 -0
- package/dist/hooks/useStorage.d.ts +18 -0
- package/dist/hooks/useStorage.d.ts.map +1 -0
- package/dist/hooks/useStorage.js +59 -0
- package/dist/hooks/useStorage.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces.d.ts +27 -0
- package/dist/interfaces.d.ts.map +1 -0
- package/dist/interfaces.js +2 -0
- package/dist/interfaces.js.map +1 -0
- package/dist/plugins/explain.d.ts +3 -0
- package/dist/plugins/explain.d.ts.map +1 -0
- package/dist/plugins/explain.js +15 -0
- package/dist/plugins/explain.js.map +1 -0
- package/dist/ruru.d.ts +15 -0
- package/dist/ruru.d.ts.map +1 -0
- package/dist/ruru.js +69 -0
- package/dist/ruru.js.map +1 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +40 -0
- package/dist/server.js.map +1 -0
- package/package.json +88 -9
- package/.idea/encodings.xml +0 -6
- package/.idea/jsLibraryMappings.xml +0 -6
- package/.idea/libraries/node_js_node_modules.xml +0 -14
- package/.idea/modules.xml +0 -8
- package/.idea/node.js.iml +0 -9
- package/.idea/workspace.xml +0 -328
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# ruru
|
|
2
|
+
|
|
3
|
+
## 2.0.0-0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#125](https://github.com/benjie/postgraphile-private/pull/125)
|
|
8
|
+
[`91f2256b3`](https://github.com/benjie/postgraphile-private/commit/91f2256b3fd699bec19fc86f1ca79df057e58639)
|
|
9
|
+
Thanks [@benjie](https://github.com/benjie)! - Initial changesets release
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
[[`91f2256b3`](https://github.com/benjie/postgraphile-private/commit/91f2256b3fd699bec19fc86f1ca79df057e58639)]:
|
|
15
|
+
- graphile-config@0.0.1-0.0
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © `2022` Benjie Gillam
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the “Software”), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# ruru
|
|
2
|
+
|
|
3
|
+
A [Gra*fast*][grafast]-enhanced distribution of [Graph*i*QL][graphiql].
|
|
4
|
+
|
|
5
|
+
**PRERELEASE**: this is pre-release software; use at your own risk and do not
|
|
6
|
+
embed into public-facing projects. This will likely change a lot before it's
|
|
7
|
+
ultimately released. The pre-release nature also explains the shocking lack of
|
|
8
|
+
documentation.
|
|
9
|
+
|
|
10
|
+
## Usage - CLI
|
|
11
|
+
|
|
12
|
+
We recommend that you install this alongside `http-proxy`:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
yarn add http-proxy ruru
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Then you can run something like the following to automatically proxy requests
|
|
19
|
+
(bypassing CORS issues):
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
yarn ruru -SPe http://localhost:5678/graphql
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Usage:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
ruru
|
|
29
|
+
|
|
30
|
+
Run a Ruru server
|
|
31
|
+
|
|
32
|
+
Options:
|
|
33
|
+
--help Show help [boolean]
|
|
34
|
+
--version Show version number [boolean]
|
|
35
|
+
-e, --endpoint endpoint for query and mutation operations
|
|
36
|
+
[string] [default: "http://localhost:5678/graphql"]
|
|
37
|
+
-p, --port port number to run the server on [number] [default: 1337]
|
|
38
|
+
-P, --proxy Proxy requests to work around CORS issues [boolean]
|
|
39
|
+
-S, --subscriptions enable subscriptions, converting --endpoint to a ws:// URL [boolean] [default: false]
|
|
40
|
+
-s, --subscription-endpoint endpoint for subscription operations (overrides -S) [string]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Usage - bundle
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<!-- optionally import Prettier for query formatting -->
|
|
47
|
+
<script src="https://unpkg.com/prettier@1.13.0/standalone.js"></script>
|
|
48
|
+
<script src="https://unpkg.com/prettier@1.13.0/parser-graphql.js"></script>
|
|
49
|
+
<!-- Required below here -->
|
|
50
|
+
<div id="ruru-root"></div>
|
|
51
|
+
<link href="https://unpkg.com/graphiql/graphiql.min.css" rel="stylesheet" />
|
|
52
|
+
<script crossorigin src="https://unpkg.com/ruru/bundle/ruru.min.js"></script>
|
|
53
|
+
<script>
|
|
54
|
+
const { React, createRoot, Ruru } = RuruBundle;
|
|
55
|
+
const tree = React.createElement(Ruru, {
|
|
56
|
+
endpoint: "/graphql",
|
|
57
|
+
});
|
|
58
|
+
const container = document.getElementById("ruru-root");
|
|
59
|
+
const root = createRoot(container);
|
|
60
|
+
root.render(tree);
|
|
61
|
+
</script>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Usage - library
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
import { Ruru } from "ruru";
|
|
68
|
+
|
|
69
|
+
React.render(<Ruru endpoint="/graphql" />);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Usage - middleware
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
import { ruruHTML } from "ruru/server";
|
|
76
|
+
|
|
77
|
+
// ...
|
|
78
|
+
|
|
79
|
+
app.get("/", (req, res, next) => {
|
|
80
|
+
res.writeHead(200, { "Content-Type": "application/html" });
|
|
81
|
+
return res.end(
|
|
82
|
+
ruruHTML({
|
|
83
|
+
endpoint: "/graphql",
|
|
84
|
+
}),
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Why "ruru"?
|
|
90
|
+
|
|
91
|
+
Jem and I are big fans of the late Terry Pratchett's Discworld universe. The
|
|
92
|
+
city at the centre of many a Discworld tale is the twin-city city-state of
|
|
93
|
+
Ankh-Morpork. A "morepork" is a type of New Zealand owl, known in Māori as
|
|
94
|
+
"ruru." Owls have excellent sight, and Ruru helps you to get an insight into not
|
|
95
|
+
just the inputs and outputs of your API, but also what it does internally.
|
|
96
|
+
|
|
97
|
+
RURU is also an abbreviation for checks to use when gathering information: "is
|
|
98
|
+
it Reliable, Up-to-date, Relevant, and Useful?" We hope that you'll find Ruru to
|
|
99
|
+
be all those things!
|
|
100
|
+
|
|
101
|
+
<details>
|
|
102
|
+
<summary>And this last reason is a little ru-rude...</summary>
|
|
103
|
+
|
|
104
|
+
... in the Quechua languages, the term "ruru" may refer to, among other things,
|
|
105
|
+
"testicle." So when your GraphQL operation isn't doing what you expect and
|
|
106
|
+
you're thinking to yourself "this is b\*ll\*cks," then you'll know this is a job
|
|
107
|
+
for Ruru!
|
|
108
|
+
|
|
109
|
+
</details>
|
|
110
|
+
|
|
111
|
+
[GNU Terry Pratchett](http://www.gnuterrypratchett.com/)
|
|
112
|
+
|
|
113
|
+
[graphiql]: https://github.com/graphql/graphiql
|
|
114
|
+
[grafast]: https://grafast.org
|