From 11c55f6249f9baf84a743c0c3c8aaea9a7596634 Mon Sep 17 00:00:00 2001 From: Julian Goacher Date: Wed, 25 Sep 2024 18:02:44 +0100 Subject: [PATCH] When running env import, add default "objects" property to package.json --- packages/mdctl-import-adapter/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/mdctl-import-adapter/index.js b/packages/mdctl-import-adapter/index.js index 4c3d28f2..0468027e 100644 --- a/packages/mdctl-import-adapter/index.js +++ b/packages/mdctl-import-adapter/index.js @@ -7,7 +7,7 @@ const EventEmitter = require('events'), _ = require('lodash'), pluralize = require('pluralize'), { ImportSection } = require('@medable/mdctl-core/streams/section'), - { parseString, isCustomName } = require('@medable/mdctl-core-utils/values'), + { isSet, parseString, isCustomName } = require('@medable/mdctl-core-utils/values'), { md5FileHash } = require('@medable/mdctl-node-utils/crypto'), { privatesAccessor } = require('@medable/mdctl-core-utils/privates'), { OutputStream } = require('@medable/mdctl-core/streams/chunk-stream'), @@ -102,8 +102,11 @@ class ImportFileTreeAdapter extends EventEmitter { async loadPackageFromObject() { const { packageData, input, format } = privatesAccessor(this), - section = new ImportSection(packageData, 'package', `package.${format}`, input) - return { results: [section.content], blobResults: [] } + { content } = new ImportSection(packageData, 'package', `package.${format}`, input) + if (!isSet(content.object)) { + content.object = 'package' + } + return { results: [content], blobResults: [] } } async loadFileContent(f) {