Skip to content

Commit

Permalink
Support for multiple manifests in build tools
Browse files Browse the repository at this point in the history
  • Loading branch information
wictorwilen committed Mar 3, 2021
1 parent 7d239c2 commit d153f9a
Show file tree
Hide file tree
Showing 8 changed files with 531 additions and 64 deletions.
32 changes: 32 additions & 0 deletions docs/docs/using-multiple-manifests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Using multiple manifest files

> **NOTE**: requires `yoteams-build-core` 1.1.0 or later
. This feature is currently in preview (`1.1.0-preview`)

Yo Teams supports having multiple manifests files. There are many scenarios where you would like to have multiple manifest files and Teams App packages generated, for instance:

* Having one application but multiple Teams Apps, such as one for users and one for admins, but still using the same hosting and solution
* Working with multiple environments and you want to build different manifests for different environments, including different icons
* Working with multiple developer environments where `validDomains` and Tab SSO App Id URI's are different.

## How to use multiple manifests with Yo Teams

By default, the scaffolded project will contain one `manifest.json`, located in `./src/manifest/`. To add additional manifest files you either create a new `.json` file and manually create the manifest, or copy the existing manifest into a new file in the same folder.

The build tasks `manifest` and `validate-manifest` will now work cross all those defined manifest.json files and validate and create a separate package for each of them. The package name will be the name of the `packageName` in the manifest and only referenced icons and localization files will be included in the package.

## Add this feature to an existing project

If you scaffolded a project using Yo Teams v 3.0.x then you might need to update the build tools to support this feature. This is done using the following command

``` bash
npm install yoteams-build-core@preview --save-dev
```

## A word of caution

When working with multiple manifests there are a couple of things to keep in mind.

If you create a new manifest from a copy of an existing one it is important that you change the `packageName` so that they are different - as that is used to create the package zip file.

If you intend to use the multiple packages in the same environment it is required that you have different `id`'s in your manifest files.
6 changes: 6 additions & 0 deletions packages/yoteams-build-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [*Unreleased*] - <**>

### Added

* Support for multiple manifest files, see https://github.com/pnp/generator-teams/tree/master/docs/docs/using-multiple-manifests.md

## [*1.0.1*] - <*2021-03-02*>

### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/yoteams-build-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ core.setup(gulp, config);
The following Gulp tasks are defined by the package:

* **`build`** - build the solution. Runs the following tasks in series: `webpack`, `styles`, `static:copy` and `static:inject`
* **`manifest`** - packages the manifest. The `validate-manifest` task is run as a part of this task
* **`manifest`** - packages the manifests. The `validate-manifest` task is run as a part of this task
* **`serve`** - builds and runs the solution on the local machine, background re-compilation when files are changed
* **`ngrok-serve`** - builds and runs the solution on the local machine with ngrok support, see below
* **`webpack`** - runs webpack on the solution by running `webpack:client` and `webpack:server` in parallel
Expand Down
Loading

0 comments on commit d153f9a

Please sign in to comment.