Skip to content

Commit 77f97da

Browse files
committed
chore: nicer imports of JSON files
1 parent acf014e commit 77f97da

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

gulpfile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ 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

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)