UNPKG

@salesforce/source-deploy-retrieve

Version:

JavaScript library to run Salesforce metadata deploys and retrieves

52 lines 1.63 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BundleSourceAdapter = void 0; const mixedContentSourceAdapter_1 = require("./mixedContentSourceAdapter"); /** * Handles _bundle_ types. A bundle component has all its source files, including the * root metadata xml, contained in its own directory. * * __Example Types__: * * LightningComponentBundle, AuraDefinitionBundle, CustomObject * * __Example Structure__: * ```text * foos/ * ├── myFoo/ * | ├── myFoo.js * | ├── myFooStyle.css * | ├── myFoo.html * | ├── myFoo.js-meta.xml *``` */ class BundleSourceAdapter extends mixedContentSourceAdapter_1.MixedContentSourceAdapter { ownFolder = true; /** * Excludes empty bundle directories. * * e.g. * lwc/ * ├── myFoo/ * | ├── myFoo.js * | ├── myFooStyle.css * | ├── myFoo.html * | ├── myFoo.js-meta.xml * ├── emptyLWC/ * * so we shouldn't populate with the `emptyLWC` directory * * @param trigger Path that `getComponent` was called with * @param component Component to populate properties on * @protected */ populate(trigger, component) { if (this.tree.isDirectory(trigger) && !this.tree.readDirectory(trigger)?.length) { // if it's an empty directory, don't include it (e.g., lwc/emptyLWC) return; } return super.populate(trigger, component); } } exports.BundleSourceAdapter = BundleSourceAdapter; //# sourceMappingURL=bundleSourceAdapter.js.map