@graphenedata/cli 0.0.10 → 0.0.11
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/cli.ts +6 -1
- package/dist/cli/cli.js +121 -118
- package/dist/docs/agent-instructions.md +18 -0
- package/dist/docs/graphene.md +310 -182
- package/dist/ui/app.css +8 -10
- package/dist/ui/internal/NavSidebar.svelte +24 -8
- package/dist/ui/internal/NavSidebarHMR.svelte +8 -0
- package/dist/ui/internal/queryEngine.ts +1 -1
- package/dist/ui/web.js +1 -1
- package/package.json +1 -1
package/dist/ui/app.css
CHANGED
|
@@ -112,27 +112,25 @@ html {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
body {
|
|
115
|
+
display: flex;
|
|
116
|
+
margin: 0;
|
|
117
|
+
min-height: 100vh;
|
|
115
118
|
font-family: "Inter", var(--ui-font-family);
|
|
116
119
|
line-height: 1.7;
|
|
117
|
-
margin: 0;
|
|
118
120
|
color: var(--base-heading);
|
|
119
|
-
min-height: 100vh;
|
|
120
|
-
display: flex;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
nav {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
padding
|
|
124
|
+
width: 200px;
|
|
125
|
+
flex-shrink: 0;
|
|
126
|
+
padding: 32px 0 16px 0px;
|
|
127
127
|
border-right: 1px solid var(--base-200);
|
|
128
|
-
background: #fbfbfd;
|
|
129
128
|
}
|
|
130
129
|
|
|
131
130
|
main {
|
|
132
131
|
flex: 1;
|
|
133
|
-
|
|
134
|
-
padding:
|
|
135
|
-
margin: 0 auto;
|
|
132
|
+
min-width: 0;
|
|
133
|
+
padding: 20px 48px 80px;
|
|
136
134
|
}
|
|
137
135
|
|
|
138
136
|
/* Default border color */
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/** @type {string} */
|
|
4
3
|
export let currentFile = ''
|
|
4
|
+
/** @type {string[]} */
|
|
5
|
+
export let files = []
|
|
6
|
+
/** @type {((href: string) => void) | undefined} */
|
|
7
|
+
export let onNavigate = undefined
|
|
8
|
+
/** @type {string} */
|
|
9
|
+
export let baseRoute = ''
|
|
5
10
|
|
|
6
11
|
let tree = []
|
|
7
12
|
let flatNodes = []
|
|
@@ -9,16 +14,17 @@
|
|
|
9
14
|
let treeSignature = ''
|
|
10
15
|
let lastCurrent = ''
|
|
11
16
|
|
|
12
|
-
$: normalizedFiles = (
|
|
17
|
+
$: normalizedFiles = (files || [])
|
|
13
18
|
.map((file) => file.replace(/^\.\//, '').replace(/\\/g, '/'))
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
|
|
21
|
+
$: normalizedCurrent = deriveCurrentFile(currentFile, normalizedFiles, baseRoute)
|
|
16
22
|
$: currentRoute = normalizedCurrent ? pathToRoute(normalizedCurrent) : '/'
|
|
17
23
|
|
|
18
|
-
function deriveCurrentFile () {
|
|
24
|
+
function deriveCurrentFile (_currentFile, _normalizedFiles, _baseRoute) {
|
|
19
25
|
let fromProp = normalizeFilePath(currentFile)
|
|
20
26
|
let route = getLocationRoute()
|
|
21
|
-
if (route) {
|
|
27
|
+
if (route && normalizedFiles) {
|
|
22
28
|
let match = normalizedFiles.find((file) => pathToRoute(file) === route)
|
|
23
29
|
if (match) return match
|
|
24
30
|
}
|
|
@@ -190,8 +196,16 @@
|
|
|
190
196
|
|
|
191
197
|
function pathToRoute (path) {
|
|
192
198
|
let clean = path.replace(/\.md$/, '')
|
|
193
|
-
|
|
194
|
-
return '/'
|
|
199
|
+
let prefix = baseRoute ? '/' + baseRoute : ''
|
|
200
|
+
if (!clean || clean === 'index') return prefix || '/'
|
|
201
|
+
return prefix + '/' + clean
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function handleLinkClick (event, href) {
|
|
205
|
+
if (!onNavigate) return
|
|
206
|
+
if (href.startsWith('http') || href.startsWith('//')) return
|
|
207
|
+
event.preventDefault()
|
|
208
|
+
onNavigate(href)
|
|
195
209
|
}
|
|
196
210
|
</script>
|
|
197
211
|
|
|
@@ -221,6 +235,7 @@
|
|
|
221
235
|
href={node.route}
|
|
222
236
|
class={node.route === currentRoute ? 'active' : ''}
|
|
223
237
|
aria-current={node.route === currentRoute ? 'page' : undefined}
|
|
238
|
+
on:click={(e) => handleLinkClick(e, node.route)}
|
|
224
239
|
>
|
|
225
240
|
{node.label}
|
|
226
241
|
</a>
|
|
@@ -235,6 +250,7 @@
|
|
|
235
250
|
href={node.route}
|
|
236
251
|
class={node.path === normalizedCurrent ? 'active' : ''}
|
|
237
252
|
aria-current={node.path === normalizedCurrent ? 'page' : undefined}
|
|
253
|
+
on:click={(e) => handleLinkClick(e, node.route)}
|
|
238
254
|
>
|
|
239
255
|
<span>{node.label}</span>
|
|
240
256
|
</a>
|
|
@@ -81,7 +81,7 @@ async function runNode (n: QueryNode) {
|
|
|
81
81
|
let response = await fetch('/_api/query', {
|
|
82
82
|
method: 'POST',
|
|
83
83
|
headers: {'Content-Type': 'application/json'},
|
|
84
|
-
body: JSON.stringify({params, gsql, hashes, routePath: getRoutePath()}),
|
|
84
|
+
body: JSON.stringify({params, gsql, hashes, routePath: getRoutePath(), repoId: window.$GRAPHENE?.repoId}),
|
|
85
85
|
})
|
|
86
86
|
let hash = response.headers.get('ETag') || ''
|
|
87
87
|
|
package/dist/ui/web.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {getErrors} from './internal/telemetry.ts'
|
|
2
2
|
import './app.css'
|
|
3
3
|
import {isLoading} from './internal/queryEngine.ts'
|
|
4
|
-
import NavSidebar from './internal/
|
|
4
|
+
import NavSidebar from './internal/NavSidebarHMR.svelte'
|
|
5
5
|
|
|
6
6
|
import Area from './components/Area.svelte'
|
|
7
7
|
import AreaChart from './components/AreaChart.svelte'
|