PolymerLabs/polymer-workspaces

Name: polymer-workspaces

Owner: PolymerLabs

Description: Work across multiple polymer repos

Created: 2017-09-19 20:04:17.0

Updated: 2018-03-13 18:11:46.0

Pushed: 2018-03-29 19:58:44.0

Homepage: null

Size: 110

Language: TypeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

polymer-workspaces

Perform work across multiple GitHub repos. Useful for both simple and complex changes across multiple Polymer elements, tools, and/or libraries.

install --save polymer-workspaces
Example: Creating a New Workspace
t {Workspace} = require('polymer-workspace');
t path = require('path');

t workspace = new Workspace({
 Choose a "workspace" directory
r: path.resolve(process.cwd(), 'my-workspace'),
 Choose your repos (glob-matching supported)
clude: [
'Polymer/polymer',
'PolymerElements/*#2.0-preview',

 (Optional) Exclude some repos (glob-matching supported)
cludes: ['PolymerElements/iron-ajax'],
 Include a valid GitHub API token: https://github.com/blog/1509-personal-api-tokens
ken: 'GITHUB_API_TOKEN',


heck out & set up the given repos from GitHub.
t workspaceRepos = await workspace.init();

ptional: Install all required bower dependencies alongside the requested repos.
t workspace.installBowerDependencies();
Example: Running Tasks Across Repos
t {run} = require('polymer-workspace');

t {successes, failures} = await run(workspaceRepos, async(repo) => {
 Contrived Example: Copy the "main" package.json property to "module"
nst packageManifestLoc = path.join(repo.dir, 'package.json');
nst packageManifestStr = fs.readFileSync(packageManifestLoc);
nst packageManifestJson = JSON.parse(packageManifestStr);
ckageManifestJson.module = packageManifestJson.main;
.writeFileSync(packageManifestLoc, JSON.stringify(packageManifestJson));


emember to handle/report any errors:
([workspaceRepo, err] of failures) {
nsole.log(workspaceRepo.dir, err.message);

Example: Pushing Multiple Repos
t {startNewBranch, run, commitChanges, pushChangesToGithub} = require('polymer-workspace');

t startNewBranch(workspaceRepos, 'new-branch-name');
t run(workspaceRepos, async(repo) => { /* ... */ });
t commitChanges(workspaceRepos, 'this is your new commit message!');
t pushChangesToGithub(workspaceRepos);
Example: NPM Publishing Multiple Repos
t {run, publishPackagesToNpm} = require('polymer-workspace');

t run(workspaceRepos, async(repo) => { /* ... */ });
t publishPackagesToNpm(workspaceRepos, 'next');

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.