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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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
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();
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);
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);
t {run, publishPackagesToNpm} = require('polymer-workspace');
t run(workspaceRepos, async(repo) => { /* ... */ });
t publishPackagesToNpm(workspaceRepos, 'next');