Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# These are supported funding model platforms

github: [romakita]
patreon: # Replace with a single Patreon username
open_collective: tsed
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
custom: # Replace with a single custom sponsorship URL
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
assignees:
- "Romakita"
reviewers:
- "Romakita"
17 changes: 17 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Build & Release

on:
push:
pull_request:
branches:
- master

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 14.x ]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000
- name: Run lint
run: yarn test:lint

deploy-packages:
runs-on: ubuntu-latest
needs: [lint]
if: ${{ github.event_name != 'pull_request' && (contains(github.ref, 'master') || contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')) }}

strategy:
matrix:
node-version: [ 14.x ]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --frozen-lockfile --network-timeout 500000
- name: Release packages
env:
CI: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn release
18 changes: 18 additions & 0 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
issue_comment:
types: [created]
name: Automatic Rebase
jobs:
rebase:
name: Rebase
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Automatic Rebase
uses: cirrus-actions/rebase@1.3.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion bin/gflow-branches.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node

const { branches, config } = require('../src');
const { branches, config } = require("../src");

branches(config.toObject());
24 changes: 12 additions & 12 deletions bin/gflow-config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#!/usr/bin/env node

const commander = require('commander');
const { config } = require('../src');
const commander = require("commander");
const { config } = require("../src");

const options = {};

commander
.usage('<action>')
.alias('gflow config <action>')
.arguments('<action>')
.usage("<action>")
.alias("gflow config <action>")
.arguments("<action>")
.action(action => {
options.action = action;
})
.on('--help', () => {
console.log('');
console.log(' Examples:');
console.log('');
console.log(' $ gflow config list');
console.log('');
.on("--help", () => {
console.log("");
console.log(" Examples:");
console.log("");
console.log(" $ gflow config list");
console.log("");
})
.parse(process.argv);

switch (options.action) {
default:
case 'list':
case "list":
console.log(config.toObject());
}
2 changes: 1 addition & 1 deletion bin/gflow-fetch.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env nodegg
const { commands } = require('../src');
const { commands } = require("../src");

commands.Fetch.fetch();
10 changes: 5 additions & 5 deletions bin/gflow-finish.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env node

const commander = require('commander');
const { commands, config } = require('../src');
const commander = require("commander");
const { commands, config } = require("../src");

const options = {};

commander
.alias('gflow finish <fromBranch>')
.arguments('<fromBranch>')
.option('-s, --skip', 'Skip the unit test.', (v, t) => t + 1, 0)
.alias("gflow finish <fromBranch>")
.arguments("<fromBranch>")
.option("-s, --skip", "Skip the unit test.", (v, t) => t + 1, 0)
.action(fromBranch => {
options.fromBranch = fromBranch;
})
Expand Down
2 changes: 1 addition & 1 deletion bin/gflow-init.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env node
const { commands } = require('../src');
const { commands } = require("../src");

commands.Init.askQuestions();
12 changes: 6 additions & 6 deletions bin/gflow-merge.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env node

const commander = require('commander');
const { config } = require('../src');
const { mergeBranch } = require('../src/command/merge');
const commander = require("commander");
const { config } = require("../src");
const { mergeBranch } = require("../src/command/merge");

const options = {};

commander
.alias('gflow merge <fromBranch>')
.arguments('<fromBranch>')
.option('-s, --skip', 'Skip the unit test.', (v, t) => t + 1, 0)
.alias("gflow merge <fromBranch>")
.arguments("<fromBranch>")
.option("-s, --skip", "Skip the unit test.", (v, t) => t + 1, 0)
.action(fromBranch => {
options.fromBranch = fromBranch;
})
Expand Down
24 changes: 14 additions & 10 deletions bin/gflow-new.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
#!/usr/bin/env node

const commander = require('commander');
const { config } = require('../src');
const { commands } = require('../src');
const commander = require("commander");
const { config } = require("../src");
const { commands } = require("../src");

const options = {};

const branches = Object.keys(config.branchTypes).join('|');
const branches = Object.keys(config.branchTypes).join("|");

commander
.usage(`[${branches}] <branchName> [fromBranch]`)
.arguments('<branchName> [fromBranch]')
.alias('gflow new')
.arguments("<branchName> [fromBranch]")
.alias("gflow new")
.action((...args) => {
const [_type_, _branchName_, _fromBranch_] = args.slice(0, args.length - 1);

if (!config.branchTypes[_type_]) {
options.type = '';
options.type = "";
options.branchName = _type_;

const type = Object.keys(config.branchTypes)
.find((t) => options.branchName.startsWith(t));
const type = Object.keys(config.branchTypes).find(t =>
options.branchName.startsWith(t)
);

if (type) {
options.type = type;
options.branchName = options.branchName.replace(new RegExp(`^${type}[-_/]`), '');
options.branchName = options.branchName.replace(
new RegExp(`^${type}[-_/]`),
""
);
}
} else {
options.type = _type_;
Expand Down
26 changes: 13 additions & 13 deletions bin/gflow-push.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#!/usr/bin/env node

const commander = require('commander');
const { config, commands } = require('../src');
const commander = require("commander");
const { config, commands } = require("../src");

const options = {};

commander
.usage('<fromBranch> [options]')
.alias('gflow push <fromBranch>')
.arguments('<fromBranch>')
.option('-f, --force', 'Force pushing branch.', (v, t) => t + 1, 0)
.option('-s, --skip', 'Skip the unit test.', (v, t) => t + 1, 0)
.usage("<fromBranch> [options]")
.alias("gflow push <fromBranch>")
.arguments("<fromBranch>")
.option("-f, --force", "Force pushing branch.", (v, t) => t + 1, 0)
.option("-s, --skip", "Skip the unit test.", (v, t) => t + 1, 0)
.action(fromBranch => {
options.fromBranch = fromBranch;
})
.on('--help', () => {
console.log('');
console.log(' Examples:');
console.log('');
console.log(' $ gflow push');
console.log('');
.on("--help", () => {
console.log("");
console.log(" Examples:");
console.log("");
console.log(" $ gflow push");
console.log("");
})
.parse(process.argv);

Expand Down
11 changes: 7 additions & 4 deletions bin/gflow-rebase-all.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/usr/bin/env node

const commander = require('commander');
const { rebaseAll, config } = require('../src');
const commander = require("commander");
const { rebaseAll, config } = require("../src");

commander
.alias('gflow rebase-all')
.option('-o, --from <fromBranch>', 'Rebase all branch from a branch. By default origin/production.')
.alias("gflow rebase-all")
.option(
"-o, --from <fromBranch>",
"Rebase all branch from a branch. By default origin/production."
)
.action(() => {})
.parse(process.argv);

Expand Down
22 changes: 11 additions & 11 deletions bin/gflow-rebase.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#!/usr/bin/env node

const commander = require('commander');
const { commands, config } = require('../src');
const commander = require("commander");
const { commands, config } = require("../src");

const options = {};

commander
.alias('gflow rebase <fromBranch>')
.arguments('<fromBranch>')
.alias("gflow rebase <fromBranch>")
.arguments("<fromBranch>")
.action(fromBranch => {
options.fromBranch = fromBranch;
})
.on('--help', () => {
console.log('');
console.log(' Examples:');
console.log('');
console.log(' $ gflow rebase');
console.log(' Is shortcut to: ');
.on("--help", () => {
console.log("");
console.log(" Examples:");
console.log("");
console.log(" $ gflow rebase");
console.log(" Is shortcut to: ");
console.log(` $ gflow rebase ${config.remoteProduction}`);
console.log('');
console.log("");
})
.parse(process.argv);

Expand Down
16 changes: 8 additions & 8 deletions bin/gflow-release.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/usr/bin/env node

const commander = require('commander');
const { release, config } = require('../src');
const commander = require("commander");
const { release, config } = require("../src");

const options = {
action: 'post'
action: "post"
};
commander
.alias('gflow release')
.usage('gflow release [pre|prepare|success|post]')
.arguments('<action>')
.alias("gflow release")
.usage("gflow release [pre|prepare|success|post]")
.arguments("<action>")
.action(action => {
options.action = action || 'post';
options.action = action || "post";
})
.parse(process.argv);

console.log('[Gflow release] Start', options.action, 'action');
console.log("[Gflow release] Start", options.action, "action");
release[options.action](config.toObject());
Loading