# grunt-salesforce-meta-xml

> Dynamically generates accompanying metadata files for salesforce metadata. Should be used in conjunction with grunt-ant-sfdc.

Latest version **0.1.3** (published 2014-12-18) · 0 weekly downloads

## Install

```sh
npm install grunt-salesforce-meta-xml
pnpm add grunt-salesforce-meta-xml
yarn add grunt-salesforce-meta-xml
bun add grunt-salesforce-meta-xml
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2014-12-18 |
| First published | 2014-12-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+9 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Richard Vanhook |
| Maintainers | rvanhook |
| Keywords | gruntplugin, salesforce |

## Links

- npm: https://www.npmjs.com/package/grunt-salesforce-meta-xml
- Repository: https://github.com/richardvanhook/grunt-salesforce-meta-xml
- Issues: https://github.com/richardvanhook/grunt-salesforce-meta-xml/issues
- npm.io page: https://npm.io/package/grunt-salesforce-meta-xml

## Dependencies (5)

- [chalk](https://npm.io/package/chalk.md) ^0.5.1
- [debug](https://npm.io/package/debug.md) ^2.1.0
- [lodash](https://npm.io/package/lodash.md) ^2.4.1
- [mmmagic](https://npm.io/package/mmmagic.md) ^0.3.12
- [minimatch](https://npm.io/package/minimatch.md) ^2.0.1

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2014-12-18
- 0.1.2 — 2014-12-18
- 0.1.1 — 2014-12-18
- 0.1.0 — 2014-12-18

## README

# grunt-salesforce-meta-xml

> Dynamically generates accompanying metadata files (files ending with "-meta.xml") for salesforce metadata.  Should be used in conjunction with [grunt-ant-sfdc](https://github.com/kevinohara80/grunt-ant-sfdc).

## Getting Started
This plugin requires Grunt `~0.4.5`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-salesforce-meta-xml --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-salesforce-meta-xml');
```

## The "salesforcemetaxml" task

### Overview

Per the [Salesforce Metadata API Developer’s Guide](https://www.salesforce.com/us/developer/docs/api_meta/), the following 11 metadata types require "an accompanying metadata file" ending in -meta.xml.  The purpose of this plugin is make generating those accompanying metadata files as simple as possible.  Metadata types not listed below do not require an accompanying metadata file.

+ [ApexClass](https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_classes.htm)
+ [ApexComponent](https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_component.htm)
+ [ApexPage](https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_pages.htm)
+ [ApexTrigger](https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_triggers.htm)
+ [DashboardFolder](https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_folder.htm)
+ [Document](https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_document.htm)
+ [DocumentFolder](https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_folder.htm)
+ [EmailFolder](https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_folder.htm)
+ [EmailTemplate](https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_emailtemplate.htm)
+ [ReportFolder](https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_folder.htm)
+ [StaticResource](https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_staticresource.htm)

### Options

You can customize the values that appear in the accompanying metadata files by including one or more metadata types as options.  For example, if you'd like to specify an apiVersion for all ApexClass metadatat files, then do the following: 

```js
salesforcemetaxml: {
  options:{
    apexclass:{
      apiVersion: '25.0'
    }
  }
},
```
By default, this plugin will generate values for the required fields for each metadata type.

### Usage Examples

This task supports all the file mapping format Grunt supports. Please read [Globbing patterns](http://gruntjs.com/configuring-tasks#globbing-patterns) and [Building the files object dynamically](http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically) for additional details.

#### Static Resources

```shell
$ tree myfolder
.
myfolder
└── staticresources
    ├── gif.resource
    ├── jpg.resource
    ├── png.resource
    ├── txt.resource
    └── zip.resource

1 directory, 5 files
```
**Generate accompanying metadata files for all static resources in myfolder:**
```js
salesforcemetaxml: {
  main: {
    expand: true, 
    cwd: 'myfolder',
    src: '**'
  }
},
```

```shell
$ grunt salesforcemetaxml
Running "salesforcemetaxml:main" (salesforcemetaxml) task
Created 5 files

Done, without errors.

$ tree myfolder
.
myfolder
└── staticresources
    ├── gif.resource
    ├── gif.resource-meta.xml
    ├── jpg.resource
    ├── jpg.resource-meta.xml
    ├── png.resource
    ├── png.resource-meta.xml
    ├── txt.resource
    ├── txt.resource-meta.xml
    ├── zip.resource
    └── zip.resource-meta.xml

1 directory, 10 files
```

---
_Source: https://npm.io/package/grunt-salesforce-meta-xml · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
