Skip to content

Commit 61743b9

Browse files
committed
chore: nicer imports of JSON files
1 parent 9ec12b6 commit 61743b9

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

gulpfile.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import zip from 'gulp-zip'
88
import rename from 'gulp-rename'
99
import del from 'delete'
1010

11-
import * as pkg from './package.json' with { type: 'json' }
12-
const { app, version, license } = pkg.default
11+
import pkg from './package.json' with { type: 'json' }
12+
const { app, version, license } = pkg
1313
const replacements = [app, { version, license }]
1414

1515
const packageUri = app.namespace
1616

1717
// read metadata from .existdb.json
18-
import * as existJSON from './.existdb.json' with { type: 'json' }
19-
const serverInfo = existJSON.default.servers.localhost
18+
import existJSON from './.existdb.json' with { type: 'json' }
19+
const serverInfo = existJSON.servers.localhost
2020
const url = new URL(serverInfo.server)
2121
const connectionOptions = {
2222
host: url.hostname,

test/util.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ import { join, basename } from 'node:path'
55
import axios from 'axios'
66
import { connect } from '@existdb/node-exist'
77

8-
import * as existJson from '../.existdb.json' with { type: 'json' }
8+
import existJson from '../.existdb.json' with { type: 'json' }
9+
const { user, password, server } = existJson.servers.localhost
910

10-
const { user, password, server } = existJson.default.servers.localhost
11-
12-
import * as pkg from '../package.json' with { type: 'json' }
13-
const appNamespace = pkg.default.app.namespace
11+
import pkg from '../package.json' with { type: 'json' }
12+
const { namespace } = pkg.app
1413

1514
// for use in custom controller tests
1615
const adminCredentials = { username: user, password }
@@ -83,7 +82,7 @@ async function install () {
8382
}
8483

8584
async function remove() {
86-
await db.app.remove(appNamespace)
85+
await db.app.remove(namespace)
8786

8887
const result = await Promise.allSettled([
8988
db.collections.remove('/db/tuttle-backup'),

0 commit comments

Comments
 (0)