@antelopejs/dms-database 0.4.4 → 0.5.1
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 +12 -10
- package/dist/automation/tableWatch.d.ts +2 -2
- package/dist/automation/tableWatch.js +3 -3
- package/dist/automation/tableWatch.js.map +1 -1
- package/dist/config.d.ts +11 -0
- package/dist/config.js +12 -0
- package/dist/config.js.map +1 -1
- package/dist/connectionAccess.d.ts +3 -0
- package/dist/connectionAccess.js +20 -0
- package/dist/connectionAccess.js.map +1 -0
- package/dist/db/models/connection_selections.model.d.ts +27 -0
- package/dist/db/models/connection_selections.model.js +17 -0
- package/dist/db/models/connection_selections.model.js.map +1 -0
- package/dist/db/models/diagram_layouts.model.d.ts +4 -4
- package/dist/db/models/diagram_layouts.model.js +14 -12
- package/dist/db/models/diagram_layouts.model.js.map +1 -1
- package/dist/db/models/diagram_notes.model.d.ts +3 -3
- package/dist/db/models/index.d.ts +1 -0
- package/dist/db/models/index.js +1 -0
- package/dist/db/models/index.js.map +1 -1
- package/dist/db/models/query_history.model.d.ts +3 -3
- package/dist/db/models/saved_queries.model.d.ts +3 -3
- package/dist/db/tables/connection_selections.table.d.ts +6 -0
- package/dist/db/tables/connection_selections.table.js +30 -0
- package/dist/db/tables/connection_selections.table.js.map +1 -0
- package/dist/db/tables/index.d.ts +1 -0
- package/dist/db/tables/index.js +1 -0
- package/dist/db/tables/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/pages/externalLock.d.ts +8 -0
- package/dist/pages/externalLock.js +32 -0
- package/dist/pages/externalLock.js.map +1 -0
- package/dist/pages/overview.js +6 -3
- package/dist/pages/overview.js.map +1 -1
- package/dist/pages/schemas.js +6 -2
- package/dist/pages/schemas.js.map +1 -1
- package/dist/routes/connections.d.ts +14 -0
- package/dist/routes/connections.js +121 -0
- package/dist/routes/connections.js.map +1 -0
- package/dist/routes/data.d.ts +10 -9
- package/dist/routes/data.js +45 -61
- package/dist/routes/data.js.map +1 -1
- package/dist/routes/diagram.d.ts +6 -6
- package/dist/routes/diagram.js +16 -6
- package/dist/routes/diagram.js.map +1 -1
- package/dist/routes/health.d.ts +1 -1
- package/dist/routes/health.js +3 -2
- package/dist/routes/health.js.map +1 -1
- package/dist/routes/index.d.ts +1 -0
- package/dist/routes/index.js +1 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/overview.d.ts +2 -2
- package/dist/routes/overview.js +11 -4
- package/dist/routes/overview.js.map +1 -1
- package/dist/routes/query.d.ts +1 -1
- package/dist/routes/query.js +26 -10
- package/dist/routes/query.js.map +1 -1
- package/dist/routes/schemas.d.ts +1 -1
- package/dist/routes/schemas.js +4 -2
- package/dist/routes/schemas.js.map +1 -1
- package/dist/routes/tables.d.ts +2 -1
- package/dist/routes/tables.js +29 -21
- package/dist/routes/tables.js.map +1 -1
- package/dist/service/browse.d.ts +14 -6
- package/dist/service/browse.js +120 -18
- package/dist/service/browse.js.map +1 -1
- package/dist/service/builderRefusal.d.ts +2 -0
- package/dist/service/builderRefusal.js +28 -0
- package/dist/service/builderRefusal.js.map +1 -0
- package/dist/service/catalog.js +2 -1
- package/dist/service/catalog.js.map +1 -1
- package/dist/service/connectionRefusals.d.ts +17 -0
- package/dist/service/connectionRefusals.js +26 -0
- package/dist/service/connectionRefusals.js.map +1 -0
- package/dist/service/connectionState.d.ts +27 -0
- package/dist/service/connectionState.js +167 -0
- package/dist/service/connectionState.js.map +1 -0
- package/dist/service/connections.d.ts +12 -0
- package/dist/service/connections.js +73 -0
- package/dist/service/connections.js.map +1 -0
- package/dist/service/database.d.ts +12 -0
- package/dist/service/database.js +30 -0
- package/dist/service/database.js.map +1 -0
- package/dist/service/declaredFields.d.ts +3 -2
- package/dist/service/declaredFields.js +6 -7
- package/dist/service/declaredFields.js.map +1 -1
- package/dist/service/health.d.ts +2 -1
- package/dist/service/health.js +48 -21
- package/dist/service/health.js.map +1 -1
- package/dist/service/introspect.d.ts +7 -5
- package/dist/service/introspect.js +49 -41
- package/dist/service/introspect.js.map +1 -1
- package/dist/service/overview.d.ts +3 -2
- package/dist/service/overview.js +4 -4
- package/dist/service/overview.js.map +1 -1
- package/dist/service/queryInspection.js +6 -3
- package/dist/service/queryInspection.js.map +1 -1
- package/dist/service/references.d.ts +3 -2
- package/dist/service/references.js +9 -8
- package/dist/service/references.js.map +1 -1
- package/dist/service/rowEdit.d.ts +3 -0
- package/dist/service/rowEdit.js +36 -3
- package/dist/service/rowEdit.js.map +1 -1
- package/dist/service/types.d.ts +1 -1
- package/dist/utils/deadline.d.ts +2 -0
- package/dist/utils/deadline.js +18 -0
- package/dist/utils/deadline.js.map +1 -0
- package/dist/utils/guards.d.ts +2 -0
- package/dist/utils/guards.js +8 -0
- package/dist/utils/guards.js.map +1 -1
- package/dist/utils/query.js +5 -4
- package/dist/utils/query.js.map +1 -1
- package/frontend-vue/app/build/components/DataBrowserAccessBar.vue +88 -0
- package/frontend-vue/app/build/components/DataGridFooter.vue +16 -1
- package/frontend-vue/app/build/components/DataGridToolbar.vue +10 -5
- package/frontend-vue/app/build/components/FeatureLocked.vue +16 -0
- package/frontend-vue/app/build/components/QueryConsoleBoard.vue +601 -0
- package/frontend-vue/app/build/components/SchemaDiagramBoard.vue +691 -0
- package/frontend-vue/app/build/composables/registerDatabaseSwitcher.ts +16 -0
- package/frontend-vue/app/build/composables/reloadForSelection.ts +11 -0
- package/frontend-vue/app/build/composables/useDataBrowserGrid.ts +1 -0
- package/frontend-vue/app/build/composables/useDataBrowserTabs.ts +100 -15
- package/frontend-vue/app/build/composables/useDatabaseConnections.ts +164 -0
- package/frontend-vue/app/build/composables/useGridAccess.ts +25 -0
- package/frontend-vue/app/build/composables/useLockedPages.ts +53 -0
- package/frontend-vue/app/build/composables/useQueryRuntime.ts +4 -4
- package/frontend-vue/app/build/composables/useSelectionRecheck.ts +23 -0
- package/frontend-vue/app/build/data/assistantOnboarding.ts +12 -0
- package/frontend-vue/app/build/data/gridData.ts +22 -1
- package/frontend-vue/app/build/data/readOnlyReason.ts +30 -0
- package/frontend-vue/app/build/data/recentTables.ts +15 -8
- package/frontend-vue/app/build/data/useStagedSave.ts +7 -1
- package/frontend-vue/app/components/DataBrowser.vue +17 -14
- package/frontend-vue/app/components/DataBrowserSidebar.vue +24 -13
- package/frontend-vue/app/components/DataGrid.vue +22 -18
- package/frontend-vue/app/components/DataGridCell.vue +5 -2
- package/frontend-vue/app/components/DatabaseSwitcher.vue +101 -0
- package/frontend-vue/app/components/QueryBuilderPanel.vue +4 -4
- package/frontend-vue/app/components/QueryConsole.vue +11 -592
- package/frontend-vue/app/components/QueryLibrary.vue +3 -3
- package/frontend-vue/app/components/QueryResultPanel.vue +5 -5
- package/frontend-vue/app/components/RowDrawer.vue +21 -14
- package/frontend-vue/app/components/SchemaDiagram.vue +10 -683
- package/frontend-vue/app/components/SchemasFilterBar.vue +3 -0
- package/frontend-vue/app/components/TableInspector.vue +19 -10
- package/frontend-vue/build/backend-boundary.ts +8 -3
- package/frontend-vue/dms.frontend.ts +2 -0
- package/frontend-vue/eslint.config.mjs +0 -1
- package/frontend-vue/i18n/locales/database-en-GB.json +43 -1
- package/frontend-vue/i18n/locales/database-fr-FR.json +43 -1
- package/frontend-vue/package.json +3 -3
- package/frontend-vue/pnpm-lock.yaml +14 -11
- package/frontend-vue/tests/accessBar.test.ts +196 -0
- package/frontend-vue/tests/backend-boundary.test.ts +15 -7
- package/frontend-vue/tests/dataBrowserDatabase.test.ts +89 -0
- package/frontend-vue/tests/databaseSwitcher.test.ts +343 -0
- package/frontend-vue/tests/editRequest.test.ts +95 -0
- package/frontend-vue/tests/externalBrowser.test.ts +318 -0
- package/frontend-vue/tests/fixtures/connections.ts +73 -0
- package/frontend-vue/tests/fixtures/serverRender.ts +135 -12
- package/frontend-vue/tests/lockedPages.test.ts +68 -0
- package/frontend-vue/tests/onDemandReads.test.ts +1 -1
- package/frontend-vue/tests/persistence.test.ts +254 -4
- package/frontend-vue/tests/recentTables.test.ts +70 -0
- package/frontend-vue/tests/registration.test.ts +15 -1
- package/frontend-vue/tests/serverRender.test.ts +80 -4
- package/frontend-vue/vitest.config.ts +11 -1
- package/package.json +19 -15
- package/dist/service/schemaRegistry.d.ts +0 -2
- package/dist/service/schemaRegistry.js +0 -8
- package/dist/service/schemaRegistry.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { onKeyStroke, watchDebounced } from '@vueuse/core'
|
|
3
|
+
import { useDatabaseConnections } from '../build/composables/useDatabaseConnections'
|
|
3
4
|
import { useDatabaseSchemas } from '../build/composables/useDatabaseSchemas'
|
|
4
5
|
import {
|
|
5
6
|
EMPTY_FILTER_STATE,
|
|
@@ -34,6 +35,7 @@ const { t, n } = useI18n()
|
|
|
34
35
|
const route = useDmsRoute()
|
|
35
36
|
const router = useDmsRouter()
|
|
36
37
|
const { schemas, isSettled: schemasSettled } = useDatabaseSchemas()
|
|
38
|
+
const { lacks } = useDatabaseConnections()
|
|
37
39
|
const schemaIds = computed(() => schemas.value.map((schema) => schema.id))
|
|
38
40
|
const listing = useSchemasListing()
|
|
39
41
|
const state = listing.state
|
|
@@ -129,6 +131,7 @@ const count = computed(() => {
|
|
|
129
131
|
/>
|
|
130
132
|
|
|
131
133
|
<InstancePicker
|
|
134
|
+
v-if="!lacks('instances')"
|
|
132
135
|
:model-value="state.instance"
|
|
133
136
|
:schema="state.scope"
|
|
134
137
|
class="w-[calc(50%-0.25rem)] sm:w-48"
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
import { CROSS_INSTANCE_VALUE } from '../build/composables/useDataBrowserTabs'
|
|
30
30
|
import { ALL_INSTANCES_PARAM, tableLink } from '../build/utils/databaseLinks'
|
|
31
31
|
import { useTableSample } from '../build/composables/useTableSample'
|
|
32
|
+
import { useDatabaseConnections } from '../build/composables/useDatabaseConnections'
|
|
32
33
|
import DrawerTabs from './DrawerTabs.vue'
|
|
33
34
|
|
|
34
35
|
// The Schemas page's row drawer (D-07), also opened from the diagram: the
|
|
@@ -61,6 +62,7 @@ const NULLISH_KINDS = new Set<FieldDescriptor['kind']>([
|
|
|
61
62
|
const BROWSE_COUNT = '/api/database/browse/count'
|
|
62
63
|
|
|
63
64
|
const { t, n } = useI18n()
|
|
65
|
+
const { lacks } = useDatabaseConnections()
|
|
64
66
|
const { copy } = useClipboard()
|
|
65
67
|
const toast = useToast()
|
|
66
68
|
|
|
@@ -301,12 +303,12 @@ async function copyName() {
|
|
|
301
303
|
<div class="flex w-full min-w-0 flex-col gap-4">
|
|
302
304
|
<header class="grid grid-cols-[minmax(0,1fr)] gap-3">
|
|
303
305
|
<div class="flex min-w-0 flex-wrap items-center gap-2">
|
|
304
|
-
<
|
|
306
|
+
<DmsEyebrowLabel
|
|
305
307
|
class="min-w-0 truncate"
|
|
306
308
|
:label="t('dms_database.inspector.eyebrow', { schema: schemaId })"
|
|
307
309
|
/>
|
|
308
310
|
<UBadge
|
|
309
|
-
v-if="!loading"
|
|
311
|
+
v-if="!loading && !lacks('instances')"
|
|
310
312
|
color="neutral"
|
|
311
313
|
variant="outline"
|
|
312
314
|
size="sm"
|
|
@@ -361,6 +363,7 @@ async function copyName() {
|
|
|
361
363
|
:label="t('dms_database.inspector.actions.browse')"
|
|
362
364
|
/>
|
|
363
365
|
<UButton
|
|
366
|
+
v-if="!lacks('queryConsole')"
|
|
364
367
|
:to="tableLink('query', address)"
|
|
365
368
|
@click="emit('success')"
|
|
366
369
|
icon="i-ph-code"
|
|
@@ -370,6 +373,7 @@ async function copyName() {
|
|
|
370
373
|
:label="t('dms_database.inspector.actions.query')"
|
|
371
374
|
/>
|
|
372
375
|
<UButton
|
|
376
|
+
v-if="!lacks('diagram')"
|
|
373
377
|
:to="tableLink('diagram', address)"
|
|
374
378
|
@click="emit('success')"
|
|
375
379
|
icon="i-ph-graph"
|
|
@@ -524,7 +528,7 @@ async function copyName() {
|
|
|
524
528
|
|
|
525
529
|
<div v-else-if="tab === 'relations'" class="grid gap-5">
|
|
526
530
|
<section class="grid gap-2">
|
|
527
|
-
<
|
|
531
|
+
<DmsEyebrowLabel
|
|
528
532
|
:label="
|
|
529
533
|
t('dms_database.inspector.relations.out', {
|
|
530
534
|
count: outgoing.length,
|
|
@@ -550,7 +554,7 @@ async function copyName() {
|
|
|
550
554
|
</p>
|
|
551
555
|
</section>
|
|
552
556
|
<section class="grid gap-2">
|
|
553
|
-
<
|
|
557
|
+
<DmsEyebrowLabel
|
|
554
558
|
:label="
|
|
555
559
|
t('dms_database.inspector.relations.in', {
|
|
556
560
|
count: incoming.length,
|
|
@@ -583,14 +587,19 @@ async function copyName() {
|
|
|
583
587
|
v-if="sampleTotal > 0"
|
|
584
588
|
class="flex min-w-0 items-center justify-between gap-2"
|
|
585
589
|
>
|
|
586
|
-
<
|
|
590
|
+
<DmsEyebrowLabel
|
|
587
591
|
class="min-w-0 truncate"
|
|
588
592
|
:label="
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
593
|
+
lacks('instances')
|
|
594
|
+
? t('dms_database.inspector.sample.position_uninstanced', {
|
|
595
|
+
position: sampleOffset + 1,
|
|
596
|
+
total: sampleTotal,
|
|
597
|
+
})
|
|
598
|
+
: t('dms_database.inspector.sample.position', {
|
|
599
|
+
position: sampleOffset + 1,
|
|
600
|
+
total: sampleTotal,
|
|
601
|
+
instance: sampleInstanceLabel,
|
|
602
|
+
})
|
|
594
603
|
"
|
|
595
604
|
/>
|
|
596
605
|
<UButton
|
|
@@ -4,7 +4,7 @@ import type { DmsVitePluginEntry } from '#dms/frontend-build'
|
|
|
4
4
|
|
|
5
5
|
type VitePlugin = Extract<DmsVitePluginEntry, { name: string }>
|
|
6
6
|
|
|
7
|
-
const BACKEND_PACKAGE =
|
|
7
|
+
const BACKEND_PACKAGE = "@antelopejs/dms-database"
|
|
8
8
|
const BACKEND_SOURCE = 'src'
|
|
9
9
|
const QUERY_OR_HASH = /[?#].*$/
|
|
10
10
|
|
|
@@ -74,6 +74,11 @@ function backendSourceFile(id: string): string | undefined {
|
|
|
74
74
|
: undefined
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
/** `path` with `/` separators, the form Vite gives an importer, so a boundary error names both paths alike on every OS. */
|
|
78
|
+
function forwardSlashes(path: string): string {
|
|
79
|
+
return path.split(sep).join('/')
|
|
80
|
+
}
|
|
81
|
+
|
|
77
82
|
/**
|
|
78
83
|
* Fails the build and the dev server when a module of the frontend resolves to
|
|
79
84
|
* a file under the `src` of the backend package: the browser reaches the
|
|
@@ -113,9 +118,9 @@ function boundaryCheck(): VitePlugin {
|
|
|
113
118
|
const from =
|
|
114
119
|
importer === undefined
|
|
115
120
|
? 'an entry point'
|
|
116
|
-
: importer.replace(QUERY_OR_HASH, '')
|
|
121
|
+
: forwardSlashes(importer.replace(QUERY_OR_HASH, ''))
|
|
117
122
|
return this.error(
|
|
118
|
-
`Backend boundary: ${from} imports ${file}, which is under the src of ${BACKEND_PACKAGE}. The frontend reaches the backend only through its HTTP interface.`,
|
|
123
|
+
`Backend boundary: ${from} imports ${forwardSlashes(file)}, which is under the src of ${BACKEND_PACKAGE}. The frontend reaches the backend only through its HTTP interface.`,
|
|
119
124
|
)
|
|
120
125
|
},
|
|
121
126
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineAsyncComponent, type Component } from 'vue'
|
|
2
2
|
import type { DmsFrontendModule } from '#dms/frontend-module'
|
|
3
|
+
import { registerDatabaseSwitcher } from './app/build/composables/registerDatabaseSwitcher'
|
|
3
4
|
|
|
4
5
|
interface VueModule {
|
|
5
6
|
default: Component
|
|
@@ -23,6 +24,7 @@ const frontendModule: DmsFrontendModule = {
|
|
|
23
24
|
defineAsyncComponent(async () => (await loader()).default),
|
|
24
25
|
)
|
|
25
26
|
}
|
|
27
|
+
sdk.registerPlugin(registerDatabaseSwitcher)
|
|
26
28
|
},
|
|
27
29
|
}
|
|
28
30
|
|
|
@@ -152,6 +152,8 @@
|
|
|
152
152
|
"close_keep": "Keep editing"
|
|
153
153
|
},
|
|
154
154
|
"grid": {
|
|
155
|
+
"count_capped": "Counts stop at {count} rows",
|
|
156
|
+
"capped": "Matches among the first {count} rows",
|
|
155
157
|
"rows": "{count} row | {count} rows",
|
|
156
158
|
"search": "Search rows",
|
|
157
159
|
"refresh": "Refresh (R)",
|
|
@@ -217,7 +219,9 @@
|
|
|
217
219
|
"rows_gone": "{count} row no longer exists: its changes were dropped. | {count} rows no longer exist: their changes were dropped.",
|
|
218
220
|
"not_written": "{count} change wasn't written and stays staged ({error}). | {count} changes weren't written and stay staged ({error}).",
|
|
219
221
|
"undo_partial": "{count} change couldn't be undone | {count} changes couldn't be undone",
|
|
220
|
-
"rows_missing": "{count} row no longer exists. | {count} rows no longer exist."
|
|
222
|
+
"rows_missing": "{count} row no longer exists. | {count} rows no longer exist.",
|
|
223
|
+
"database_changed": "The selected database changed in another tab: reload the page.",
|
|
224
|
+
"read_only_access": "Access to {connection} is read only."
|
|
221
225
|
},
|
|
222
226
|
"row": {
|
|
223
227
|
"position": "Row {index} of {total}",
|
|
@@ -243,6 +247,43 @@
|
|
|
243
247
|
"help": "An object or a list. Type null to empty the cell."
|
|
244
248
|
}
|
|
245
249
|
},
|
|
250
|
+
"connections": {
|
|
251
|
+
"own": "Project database",
|
|
252
|
+
"external": "External",
|
|
253
|
+
"engine_unknown": "Unknown engine",
|
|
254
|
+
"unknown": "This database is no longer one of the project's databases. Reload the page to see the current list.",
|
|
255
|
+
"catalog": {
|
|
256
|
+
"timed_out": "The catalog of {connection} did not answer in time.",
|
|
257
|
+
"refused": "The catalog of {connection} refused to answer. The server log names the cause."
|
|
258
|
+
},
|
|
259
|
+
"switcher": {
|
|
260
|
+
"label": "Database",
|
|
261
|
+
"menu": "Choose the database to browse",
|
|
262
|
+
"failed": "The database could not be switched.",
|
|
263
|
+
"connect": "Connect a database"
|
|
264
|
+
},
|
|
265
|
+
"access": {
|
|
266
|
+
"read": "Access to {name}: Read only",
|
|
267
|
+
"read_write": "Access to {name}: Read & write",
|
|
268
|
+
"toggle": "Allow changes to {name}",
|
|
269
|
+
"account_read_only": "This account can only read. Use an account with write access to allow changes.",
|
|
270
|
+
"account_unverified": "This account's write access could not be checked.",
|
|
271
|
+
"failed": "The access to the database could not be changed.",
|
|
272
|
+
"refused": "The project's configuration refused the change: {reason}",
|
|
273
|
+
"not_development": "Access can only change while the project runs in development. Reload the page.",
|
|
274
|
+
"no_module_entry": "The console could not find its own module in the project's configuration.",
|
|
275
|
+
"no_builder": "The project's configuration could not be written: the DMS builder did not answer.",
|
|
276
|
+
"confirm": {
|
|
277
|
+
"title": "Allow changes to {name}?",
|
|
278
|
+
"description": "{name} is your customer's live database. Changes you save are written to it at once, and the DMS cannot undo them.",
|
|
279
|
+
"action": "Allow changes",
|
|
280
|
+
"cancel": "Keep read only"
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"locked": {
|
|
284
|
+
"reason": "Not available on an external database"
|
|
285
|
+
}
|
|
286
|
+
},
|
|
246
287
|
"diagram": {
|
|
247
288
|
"title": "Diagram",
|
|
248
289
|
"description": "Tables and relations of a schema. Drag tables to arrange them; the layout is saved for the whole team.",
|
|
@@ -527,6 +568,7 @@
|
|
|
527
568
|
},
|
|
528
569
|
"sample": {
|
|
529
570
|
"position": "Row {position} of {total} · {instance}",
|
|
571
|
+
"position_uninstanced": "Row {position} of {total}",
|
|
530
572
|
"default_instance": "default instance",
|
|
531
573
|
"named_instance": "instance {name}",
|
|
532
574
|
"another": "Another row",
|
|
@@ -152,6 +152,8 @@
|
|
|
152
152
|
"close_keep": "Continuer"
|
|
153
153
|
},
|
|
154
154
|
"grid": {
|
|
155
|
+
"count_capped": "Le décompte s’arrête à {count} lignes",
|
|
156
|
+
"capped": "Correspondances parmi les {count} premières lignes",
|
|
155
157
|
"rows": "{count} ligne | {count} lignes",
|
|
156
158
|
"search": "Chercher dans les lignes",
|
|
157
159
|
"refresh": "Actualiser (R)",
|
|
@@ -217,7 +219,9 @@
|
|
|
217
219
|
"rows_gone": "{count} ligne n'existe plus : ses modifications ont été abandonnées. | {count} lignes n'existent plus : leurs modifications ont été abandonnées.",
|
|
218
220
|
"not_written": "{count} modification n'a pas été écrite et reste préparée ({error}). | {count} modifications n'ont pas été écrites et restent préparées ({error}).",
|
|
219
221
|
"undo_partial": "{count} modification n'a pas pu être annulée | {count} modifications n'ont pas pu être annulées",
|
|
220
|
-
"rows_missing": "{count} ligne n'existe plus. | {count} lignes n'existent plus."
|
|
222
|
+
"rows_missing": "{count} ligne n'existe plus. | {count} lignes n'existent plus.",
|
|
223
|
+
"database_changed": "La base sélectionnée a changé dans un autre onglet : rechargez la page.",
|
|
224
|
+
"read_only_access": "L'accès à {connection} est en lecture seule."
|
|
221
225
|
},
|
|
222
226
|
"row": {
|
|
223
227
|
"position": "Ligne {index} sur {total}",
|
|
@@ -243,6 +247,43 @@
|
|
|
243
247
|
"help": "Un objet ou une liste. Tapez null pour vider la cellule."
|
|
244
248
|
}
|
|
245
249
|
},
|
|
250
|
+
"connections": {
|
|
251
|
+
"own": "Base du projet",
|
|
252
|
+
"external": "Externe",
|
|
253
|
+
"engine_unknown": "Moteur inconnu",
|
|
254
|
+
"unknown": "Cette base ne fait plus partie des bases du projet. Rechargez la page pour voir la liste à jour.",
|
|
255
|
+
"catalog": {
|
|
256
|
+
"timed_out": "Le catalogue de {connection} n'a pas répondu à temps.",
|
|
257
|
+
"refused": "Le catalogue de {connection} a refusé de répondre. Le journal du serveur en donne la cause."
|
|
258
|
+
},
|
|
259
|
+
"switcher": {
|
|
260
|
+
"label": "Base de données",
|
|
261
|
+
"menu": "Choisir la base à parcourir",
|
|
262
|
+
"failed": "La base n'a pas pu être changée.",
|
|
263
|
+
"connect": "Connecter une base"
|
|
264
|
+
},
|
|
265
|
+
"access": {
|
|
266
|
+
"read": "Accès à {name} : lecture seule",
|
|
267
|
+
"read_write": "Accès à {name} : lecture et écriture",
|
|
268
|
+
"toggle": "Autoriser les modifications de {name}",
|
|
269
|
+
"account_read_only": "Ce compte peut seulement lire. Utilisez un compte avec accès en écriture pour autoriser les modifications.",
|
|
270
|
+
"account_unverified": "Les droits d'écriture de ce compte n'ont pas pu être vérifiés.",
|
|
271
|
+
"failed": "L'accès à la base n'a pas pu être modifié.",
|
|
272
|
+
"refused": "La configuration du projet a refusé la modification : {reason}",
|
|
273
|
+
"not_development": "L'accès ne peut changer que lorsque le projet tourne en développement. Rechargez la page.",
|
|
274
|
+
"no_module_entry": "La console n'a pas trouvé son propre module dans la configuration du projet.",
|
|
275
|
+
"no_builder": "La configuration du projet n'a pas pu être écrite : le builder DMS n'a pas répondu.",
|
|
276
|
+
"confirm": {
|
|
277
|
+
"title": "Autoriser les modifications de {name} ?",
|
|
278
|
+
"description": "{name} est la base en production de votre client. Les modifications enregistrées y sont écrites aussitôt, et le DMS ne peut pas les annuler.",
|
|
279
|
+
"action": "Autoriser les modifications",
|
|
280
|
+
"cancel": "Rester en lecture seule"
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"locked": {
|
|
284
|
+
"reason": "Indisponible sur une base externe"
|
|
285
|
+
}
|
|
286
|
+
},
|
|
246
287
|
"diagram": {
|
|
247
288
|
"title": "Diagramme",
|
|
248
289
|
"description": "Les tables d'un schéma et leurs relations. Déplacez les tables pour les arranger ; la disposition est enregistrée pour toute l'équipe.",
|
|
@@ -527,6 +568,7 @@
|
|
|
527
568
|
},
|
|
528
569
|
"sample": {
|
|
529
570
|
"position": "Ligne {position} sur {total} · {instance}",
|
|
571
|
+
"position_uninstanced": "Ligne {position} sur {total}",
|
|
530
572
|
"default_instance": "instance par défaut",
|
|
531
573
|
"named_instance": "instance {name}",
|
|
532
574
|
"another": "Une autre ligne",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"main": "./dms.frontend.ts",
|
|
7
7
|
"packageManager": "pnpm@10.6.5",
|
|
8
8
|
"engines": {
|
|
9
|
-
"@antelopejs/dms-frontend": ">=0.
|
|
9
|
+
"@antelopejs/dms-frontend": ">=0.11.1 <0.12.0"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"dev": "pnpm --dir ../playground frontend:dev",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"test": "vitest run"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@antelopejs/interface-core": ">=0.
|
|
22
|
-
"@antelopejs/interface-database": ">=0.
|
|
21
|
+
"@antelopejs/interface-core": ">=0.5.1 <0.6.0",
|
|
22
|
+
"@antelopejs/interface-database": ">=0.4.0 <0.5.0",
|
|
23
23
|
"@codemirror/autocomplete": "^6.18.6",
|
|
24
24
|
"@codemirror/commands": "^6.8.1",
|
|
25
25
|
"@codemirror/lang-javascript": "^6.2.4",
|
|
@@ -9,11 +9,11 @@ importers:
|
|
|
9
9
|
.:
|
|
10
10
|
dependencies:
|
|
11
11
|
'@antelopejs/interface-core':
|
|
12
|
-
specifier: '>=0.
|
|
13
|
-
version: 0.
|
|
12
|
+
specifier: '>=0.5.1 <0.6.0'
|
|
13
|
+
version: 0.5.1
|
|
14
14
|
'@antelopejs/interface-database':
|
|
15
|
-
specifier: '>=0.
|
|
16
|
-
version: 0.
|
|
15
|
+
specifier: '>=0.4.0 <0.5.0'
|
|
16
|
+
version: 0.4.0(@antelopejs/interface-core@0.5.1)
|
|
17
17
|
'@codemirror/autocomplete':
|
|
18
18
|
specifier: ^6.18.6
|
|
19
19
|
version: 6.20.3
|
|
@@ -88,11 +88,11 @@ packages:
|
|
|
88
88
|
resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==}
|
|
89
89
|
engines: {node: '>=10'}
|
|
90
90
|
|
|
91
|
-
'@antelopejs/interface-core@0.
|
|
92
|
-
resolution: {integrity: sha512-
|
|
91
|
+
'@antelopejs/interface-core@0.5.1':
|
|
92
|
+
resolution: {integrity: sha512-ON/7TYA1yyT8UznzKi6vnwyjRU3byNE0OcFXBmf8dE/dqp8hKjeWHVyA2EUPOngmEimCLw4idZqOS5DJqMJx3g==}
|
|
93
93
|
|
|
94
|
-
'@antelopejs/interface-database@0.
|
|
95
|
-
resolution: {integrity: sha512-
|
|
94
|
+
'@antelopejs/interface-database@0.4.0':
|
|
95
|
+
resolution: {integrity: sha512-cdVGd0qdHwkS3PHdbV9IJUyL3OoGjnmXoVbXdHPNmbwzmjUDkZQHFN2Y3b58SGsH11k3nS1EJLq0sTbKVhaKdQ==}
|
|
96
96
|
peerDependencies:
|
|
97
97
|
'@antelopejs/interface-core': '>=0.2.4 <1.0.0'
|
|
98
98
|
|
|
@@ -3111,17 +3111,20 @@ packages:
|
|
|
3111
3111
|
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
|
|
3112
3112
|
engines: {node: '>=10'}
|
|
3113
3113
|
|
|
3114
|
+
ignoredOptionalDependencies:
|
|
3115
|
+
- playwright-core
|
|
3116
|
+
|
|
3114
3117
|
snapshots:
|
|
3115
3118
|
|
|
3116
3119
|
'@alloc/quick-lru@5.2.0': {}
|
|
3117
3120
|
|
|
3118
|
-
'@antelopejs/interface-core@0.
|
|
3121
|
+
'@antelopejs/interface-core@0.5.1':
|
|
3119
3122
|
dependencies:
|
|
3120
3123
|
reflect-metadata: 0.2.2
|
|
3121
3124
|
|
|
3122
|
-
'@antelopejs/interface-database@0.
|
|
3125
|
+
'@antelopejs/interface-database@0.4.0(@antelopejs/interface-core@0.5.1)':
|
|
3123
3126
|
dependencies:
|
|
3124
|
-
'@antelopejs/interface-core': 0.
|
|
3127
|
+
'@antelopejs/interface-core': 0.5.1
|
|
3125
3128
|
|
|
3126
3129
|
'@antfu/install-pkg@2.0.1':
|
|
3127
3130
|
dependencies:
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest'
|
|
2
|
+
import {
|
|
3
|
+
answerConfirmations,
|
|
4
|
+
browserMount,
|
|
5
|
+
confirmations,
|
|
6
|
+
} from './fixtures/serverRender'
|
|
7
|
+
import {
|
|
8
|
+
OWN,
|
|
9
|
+
WAREHOUSE,
|
|
10
|
+
connectionWrites,
|
|
11
|
+
connectionsBackend,
|
|
12
|
+
connectionsState,
|
|
13
|
+
} from './fixtures/connections'
|
|
14
|
+
import type { ConnectionsState } from '../app/build/composables/useDatabaseConnections'
|
|
15
|
+
import DataBrowserAccessBar from '../app/build/components/DataBrowserAccessBar.vue'
|
|
16
|
+
|
|
17
|
+
const SWITCH = (props: Record<string, unknown>) =>
|
|
18
|
+
props['data-stub'] === 'DmsInputSwitch'
|
|
19
|
+
|
|
20
|
+
async function mountBar(state: ConnectionsState, answer?: () => unknown) {
|
|
21
|
+
const page = browserMount(
|
|
22
|
+
DataBrowserAccessBar,
|
|
23
|
+
connectionsBackend(state, { answer }),
|
|
24
|
+
)
|
|
25
|
+
await page.shown
|
|
26
|
+
await vi.waitFor(() => expect(page.reads).not.toHaveLength(0))
|
|
27
|
+
await new Promise((resolve) => setTimeout(resolve, 0))
|
|
28
|
+
return page
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type Page = Awaited<ReturnType<typeof mountBar>>
|
|
32
|
+
|
|
33
|
+
function toggle(page: Page, allowed: boolean): void {
|
|
34
|
+
const update = page.find(SWITCH)?.['onUpdate:modelValue']
|
|
35
|
+
expect(update).toBeTypeOf('function')
|
|
36
|
+
if (typeof update === 'function') update(allowed)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
describe('access bar: what it says', () => {
|
|
40
|
+
it('says read only or read and write for the external database, by its name', async () => {
|
|
41
|
+
const readOnly = await mountBar(connectionsState(WAREHOUSE))
|
|
42
|
+
expect(readOnly.text()).toContain(
|
|
43
|
+
'dms_database.connections.access.read Warehouse',
|
|
44
|
+
)
|
|
45
|
+
const readWrite = await mountBar(
|
|
46
|
+
connectionsState({ ...WAREHOUSE, access: 'read-write' }),
|
|
47
|
+
)
|
|
48
|
+
expect(readWrite.text()).toContain(
|
|
49
|
+
'dms_database.connections.access.read_write Warehouse',
|
|
50
|
+
)
|
|
51
|
+
expect(readWrite.text()).not.toContain(
|
|
52
|
+
'dms_database.connections.access.read Warehouse',
|
|
53
|
+
)
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it('is absent on the project database, which an implementation showing it for every connection gets wrong', async () => {
|
|
57
|
+
const page = await mountBar(connectionsState(OWN))
|
|
58
|
+
expect(page.text()).not.toContain('data-access-bar')
|
|
59
|
+
expect(page.find(SWITCH)).toBeUndefined()
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
it('shows the access as text only outside development, with no switch', async () => {
|
|
63
|
+
const page = await mountBar(
|
|
64
|
+
connectionsState(WAREHOUSE, { accessEditable: false }),
|
|
65
|
+
)
|
|
66
|
+
expect(page.text()).toContain(
|
|
67
|
+
'dms_database.connections.access.read Warehouse',
|
|
68
|
+
)
|
|
69
|
+
expect(page.find(SWITCH)).toBeUndefined()
|
|
70
|
+
expect(page.text()).not.toContain('account_read_only')
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
describe('access bar: an account that cannot write', () => {
|
|
75
|
+
it.each([false, null])(
|
|
76
|
+
'locks the switch on read while canWrite is %s, which an implementation that leaves it free gets wrong',
|
|
77
|
+
async (canWrite) => {
|
|
78
|
+
const page = await mountBar(connectionsState({ ...WAREHOUSE, canWrite }))
|
|
79
|
+
expect(page.find(SWITCH)).toMatchObject({ disabled: true })
|
|
80
|
+
expect(page.text()).toContain('name="i-ph-lock"')
|
|
81
|
+
},
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
it.each([false, null])(
|
|
85
|
+
'leaves the switch free on read and write while canWrite is %s, so it can go back to read: an implementation locking on canWrite alone traps the access',
|
|
86
|
+
async (canWrite) => {
|
|
87
|
+
const page = await mountBar(
|
|
88
|
+
connectionsState({ ...WAREHOUSE, access: 'read-write', canWrite }, {}),
|
|
89
|
+
() => connectionsState(WAREHOUSE),
|
|
90
|
+
)
|
|
91
|
+
expect(page.find(SWITCH)).toMatchObject({ disabled: false })
|
|
92
|
+
toggle(page, false)
|
|
93
|
+
await vi.waitFor(() =>
|
|
94
|
+
expect(connectionWrites(page.reads)).toEqual([
|
|
95
|
+
{
|
|
96
|
+
method: 'PUT',
|
|
97
|
+
url: '/api/database/connections/warehouse/access',
|
|
98
|
+
body: { access: 'read' },
|
|
99
|
+
},
|
|
100
|
+
]),
|
|
101
|
+
)
|
|
102
|
+
},
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
it('tells an account that cannot write from one the catalog did not answer for, which an implementation with one text for both gets wrong', async () => {
|
|
106
|
+
const refused = await mountBar(
|
|
107
|
+
connectionsState({ ...WAREHOUSE, canWrite: false }),
|
|
108
|
+
)
|
|
109
|
+
const unchecked = await mountBar(
|
|
110
|
+
connectionsState({ ...WAREHOUSE, canWrite: null }),
|
|
111
|
+
)
|
|
112
|
+
expect(refused.text()).toContain(
|
|
113
|
+
'dms_database.connections.access.account_read_only',
|
|
114
|
+
)
|
|
115
|
+
expect(refused.text()).not.toContain('account_unverified')
|
|
116
|
+
expect(unchecked.text()).toContain(
|
|
117
|
+
'dms_database.connections.access.account_unverified',
|
|
118
|
+
)
|
|
119
|
+
expect(unchecked.text()).not.toContain('account_read_only')
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
it('leaves the switch free, with no account message, when the account can write', async () => {
|
|
123
|
+
const page = await mountBar(connectionsState(WAREHOUSE))
|
|
124
|
+
expect(page.find(SWITCH)).toMatchObject({ disabled: false })
|
|
125
|
+
expect(page.text()).not.toContain('account_read_only')
|
|
126
|
+
})
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
describe('access bar: changing the access', () => {
|
|
130
|
+
it('asks before it allows writes, and writes nothing when the user declines', async () => {
|
|
131
|
+
answerConfirmations(false)
|
|
132
|
+
const page = await mountBar(connectionsState(WAREHOUSE))
|
|
133
|
+
toggle(page, true)
|
|
134
|
+
await vi.waitFor(() => expect(confirmations).toHaveLength(1))
|
|
135
|
+
await new Promise((resolve) => setTimeout(resolve, 0))
|
|
136
|
+
expect(connectionWrites(page.reads)).toEqual([])
|
|
137
|
+
expect(confirmations[0]).toMatchObject({
|
|
138
|
+
color: 'warning',
|
|
139
|
+
description:
|
|
140
|
+
'dms_database.connections.access.confirm.description Warehouse',
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
it('allows writes once the user confirms, and then shows read and write from the answer', async () => {
|
|
145
|
+
answerConfirmations(true)
|
|
146
|
+
const written = connectionsState({ ...WAREHOUSE, access: 'read-write' })
|
|
147
|
+
const page = await mountBar(connectionsState(WAREHOUSE), () => written)
|
|
148
|
+
toggle(page, true)
|
|
149
|
+
await vi.waitFor(() =>
|
|
150
|
+
expect(page.text()).toContain(
|
|
151
|
+
'dms_database.connections.access.read_write Warehouse',
|
|
152
|
+
),
|
|
153
|
+
)
|
|
154
|
+
expect(confirmations).toHaveLength(1)
|
|
155
|
+
expect(connectionWrites(page.reads)).toEqual([
|
|
156
|
+
{
|
|
157
|
+
method: 'PUT',
|
|
158
|
+
url: '/api/database/connections/warehouse/access',
|
|
159
|
+
body: { access: 'read-write' },
|
|
160
|
+
},
|
|
161
|
+
])
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
it('goes back to read without asking', async () => {
|
|
165
|
+
answerConfirmations(false)
|
|
166
|
+
const page = await mountBar(
|
|
167
|
+
connectionsState({ ...WAREHOUSE, access: 'read-write' }),
|
|
168
|
+
() => connectionsState(WAREHOUSE),
|
|
169
|
+
)
|
|
170
|
+
toggle(page, false)
|
|
171
|
+
await vi.waitFor(() =>
|
|
172
|
+
expect(connectionWrites(page.reads)).toEqual([
|
|
173
|
+
{
|
|
174
|
+
method: 'PUT',
|
|
175
|
+
url: '/api/database/connections/warehouse/access',
|
|
176
|
+
body: { access: 'read' },
|
|
177
|
+
},
|
|
178
|
+
]),
|
|
179
|
+
)
|
|
180
|
+
expect(confirmations).toEqual([])
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
it('keeps the access it showed when the server refuses the change', async () => {
|
|
184
|
+
answerConfirmations(true)
|
|
185
|
+
const page = await mountBar(connectionsState(WAREHOUSE), () => {
|
|
186
|
+
throw new Error('This account can only read.')
|
|
187
|
+
})
|
|
188
|
+
toggle(page, true)
|
|
189
|
+
await vi.waitFor(() => expect(connectionWrites(page.reads)).toHaveLength(1))
|
|
190
|
+
await new Promise((resolve) => setTimeout(resolve, 0))
|
|
191
|
+
expect(page.text()).toContain(
|
|
192
|
+
'dms_database.connections.access.read Warehouse',
|
|
193
|
+
)
|
|
194
|
+
expect(page.errors).toEqual([])
|
|
195
|
+
})
|
|
196
|
+
})
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mkdirSync,
|
|
3
3
|
mkdtempSync,
|
|
4
|
+
realpathSync,
|
|
4
5
|
rmSync,
|
|
5
6
|
symlinkSync,
|
|
6
7
|
writeFileSync,
|
|
7
8
|
} from 'node:fs'
|
|
8
9
|
import { tmpdir } from 'node:os'
|
|
9
10
|
import { join } from 'node:path'
|
|
10
|
-
import { build, type Plugin } from 'vite'
|
|
11
|
+
import { build, normalizePath, type Plugin } from 'vite'
|
|
11
12
|
import { afterEach, beforeEach, expect, it } from 'vitest'
|
|
12
13
|
import { backendBoundary } from '../build/backend-boundary.ts'
|
|
13
14
|
|
|
@@ -15,7 +16,9 @@ const BOUNDARY = 'Backend boundary: '
|
|
|
15
16
|
|
|
16
17
|
let root: string
|
|
17
18
|
beforeEach(() => {
|
|
18
|
-
root =
|
|
19
|
+
root = realpathSync.native(
|
|
20
|
+
mkdtempSync(join(tmpdir(), 'dms-database-boundary-')),
|
|
21
|
+
)
|
|
19
22
|
mkdirSync(join(root, 'backend/src'), { recursive: true })
|
|
20
23
|
mkdirSync(join(root, 'backend/dist'), { recursive: true })
|
|
21
24
|
mkdirSync(join(root, 'frontend'), { recursive: true })
|
|
@@ -28,6 +31,11 @@ beforeEach(() => {
|
|
|
28
31
|
})
|
|
29
32
|
afterEach(() => rmSync(root, { recursive: true, force: true }))
|
|
30
33
|
|
|
34
|
+
/** A file under the root as the plugin names it, with Vite's `/` separators. */
|
|
35
|
+
function reported(path: string) {
|
|
36
|
+
return normalizePath(join(root, path))
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
function bundle(entry: string, extra: Plugin[] = []) {
|
|
32
40
|
writeFileSync(join(root, 'frontend/entry.ts'), entry)
|
|
33
41
|
return build({
|
|
@@ -47,8 +55,8 @@ it('fails on an import of the backend source and names both files', async () =>
|
|
|
47
55
|
'import { api } from "../backend/src/api"\nexport default api\n',
|
|
48
56
|
)
|
|
49
57
|
await expect(failing).rejects.toThrow(BOUNDARY)
|
|
50
|
-
await expect(failing).rejects.toThrow(
|
|
51
|
-
await expect(failing).rejects.toThrow(
|
|
58
|
+
await expect(failing).rejects.toThrow(reported('frontend/entry.ts'))
|
|
59
|
+
await expect(failing).rejects.toThrow(reported('backend/src/api.ts'))
|
|
52
60
|
})
|
|
53
61
|
|
|
54
62
|
it('fails on an import nested below the backend source', async () => {
|
|
@@ -61,7 +69,7 @@ it('fails on an import nested below the backend source', async () => {
|
|
|
61
69
|
'import { deep } from "../backend/src/x/y/deep"\nexport default deep\n',
|
|
62
70
|
)
|
|
63
71
|
await expect(failing).rejects.toThrow(BOUNDARY)
|
|
64
|
-
await expect(failing).rejects.toThrow(
|
|
72
|
+
await expect(failing).rejects.toThrow(reported('backend/src/x/y/deep.ts'))
|
|
65
73
|
})
|
|
66
74
|
|
|
67
75
|
it('accepts a backend directory that only starts with src', async () => {
|
|
@@ -110,7 +118,7 @@ it('follows a symlink the resolver returns to the backend source', async () => {
|
|
|
110
118
|
resolvingTo(() => join(root, 'frontend/linked.ts')),
|
|
111
119
|
])
|
|
112
120
|
await expect(failing).rejects.toThrow(BOUNDARY)
|
|
113
|
-
await expect(failing).rejects.toThrow(
|
|
121
|
+
await expect(failing).rejects.toThrow(reported('backend/src/api.ts'))
|
|
114
122
|
})
|
|
115
123
|
|
|
116
124
|
it('sees through a query on the resolved id', async () => {
|
|
@@ -118,7 +126,7 @@ it('sees through a query on the resolved id', async () => {
|
|
|
118
126
|
resolvingTo(() => `${join(root, 'backend/src/api.ts')}?raw`),
|
|
119
127
|
])
|
|
120
128
|
await expect(failing).rejects.toThrow(BOUNDARY)
|
|
121
|
-
await expect(failing).rejects.toThrow(
|
|
129
|
+
await expect(failing).rejects.toThrow(reported('backend/src/api.ts'))
|
|
122
130
|
})
|
|
123
131
|
|
|
124
132
|
it('lets the owning package decide, not the directory name', async () => {
|