-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support workspaces configuration from package.json (yarn/npm/mo…
…norepo)
- Loading branch information
Showing
69 changed files
with
5,022 additions
and
1,402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
**/node_modules | ||
docs | ||
examples | ||
packages/**/{test,dist}/**/*.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"extends": [ | ||
"plugin:prettier/recommended" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" | ||
}, | ||
"env": { | ||
"node": true, | ||
"es6": true | ||
}, | ||
"rules": { | ||
"no-case-declarations": "off", | ||
"no-empty": "off", | ||
"prefer-const": "off", | ||
"no-fallthrough": "off" | ||
}, | ||
"ignorePatterns": [ | ||
"**/lib/**/*.ts", | ||
"**/test/**/*.ts", | ||
"**/node_modules/**/*.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"packages/*/src/**/*.js": [ | ||
"prettier --write", | ||
"eslint --fix", | ||
"git add" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
dist | ||
docs | ||
node_modules | ||
*-lock.json | ||
*.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"printWidth": 140, | ||
"bracketSpacing": false, | ||
"trailingComma": "none", | ||
"arrowParens": "always" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#!/usr/bin/env node | ||
const commander = require('commander') | ||
const { commands, runCommand } = require('../src') | ||
const commander = require("commander"); | ||
const {commands, runCommand} = require("../src"); | ||
|
||
commander | ||
.usage('monorepo build [options]') | ||
.option('-v, --verbose', 'Enable verbose log', (v, t) => t + 1, 0) | ||
.parse(process.argv) | ||
.usage("monorepo build [options]") | ||
.option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0) | ||
.parse(process.argv); | ||
|
||
runCommand(commands.BuildCmd, commander.opts()) | ||
runCommand(commands.BuildCmd, commander.opts()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#!/usr/bin/env node | ||
const commander = require('commander') | ||
const { commands, runCommand } = require('../src') | ||
const commander = require("commander"); | ||
const {commands, runCommand} = require("../src"); | ||
|
||
commander | ||
.usage('monorepo ci <type> [options]') | ||
.arguments('<type>') | ||
.option('-v, --verbose', 'Enable verbose log', (v, t) => t + 1, 0) | ||
.usage("monorepo ci <type> [options]") | ||
.arguments("<type>") | ||
.option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0) | ||
.action((type) => { | ||
runCommand(commands.CICmd, { | ||
type, | ||
verbose: !!commander.opts().verbose | ||
}) | ||
}); | ||
}) | ||
.parse(process.argv) | ||
.parse(process.argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#!/usr/bin/env node | ||
const commander = require('commander') | ||
const { commands, runCommand } = require('../src') | ||
const commander = require("commander"); | ||
const {commands, runCommand} = require("../src"); | ||
|
||
commander | ||
.usage('monorepo clean <type> [options]') | ||
.arguments('<type>') | ||
.option('-v, --verbose', 'Enable verbose log', (v, t) => t + 1, 0) | ||
.usage("monorepo clean <type> [options]") | ||
.arguments("<type>") | ||
.option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0) | ||
.action((type) => { | ||
runCommand(commands.CleanCmd, { | ||
type, | ||
verbose: !!commander.opts().verbose | ||
}) | ||
}); | ||
}) | ||
.parse(process.argv) | ||
.parse(process.argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
#!/usr/bin/env node | ||
const commander = require('commander') | ||
const { commands, runCommand } = require('../src') | ||
const commander = require("commander"); | ||
const {commands, runCommand} = require("../src"); | ||
|
||
commander | ||
.usage('monorepo publish <type> [options]') | ||
.arguments('<type>') | ||
.option('-v, --verbose', 'Enable verbose log', (v, t) => t + 1, 0) | ||
.option('-d, --dry-run', 'Run publish in dryRun mode', (v, t) => t + 1, 0) | ||
.usage("monorepo publish <type> [options]") | ||
.arguments("<type>") | ||
.option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0) | ||
.option("-d, --dry-run", "Run publish in dryRun mode", (v, t) => t + 1, 0) | ||
.action((type) => { | ||
const options = commander.opts() | ||
const options = commander.opts(); | ||
runCommand(commands.PublishCmd, { | ||
type, | ||
verbose: !!options.verbose, | ||
dryRun: !!options.dryRun | ||
}) | ||
}); | ||
}) | ||
.parse(process.argv) | ||
|
||
.parse(process.argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
#!/usr/bin/env node | ||
const commander = require('commander') | ||
const { commands, runCommand } = require('../src') | ||
const commander = require("commander"); | ||
const {commands, runCommand} = require("../src"); | ||
|
||
commander | ||
.usage('monorepo sync <type> [options]') | ||
.arguments('<type>') | ||
.option('-v, --verbose', 'Enable verbose log', (v, t) => t + 1, 0) | ||
.usage("monorepo sync <type> [options]") | ||
.arguments("<type>") | ||
.option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0) | ||
.action((type) => { | ||
const options = commander.opts() | ||
const options = commander.opts(); | ||
runCommand(commands.SyncCmd, { | ||
type, | ||
verbose: !!options.verbose | ||
}) | ||
}); | ||
}) | ||
.parse(process.argv) | ||
.parse(process.argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
#!/usr/bin/env node | ||
const commander = require('commander') | ||
const { commands, runCommand } = require('../src') | ||
const commander = require("commander"); | ||
const {commands, runCommand} = require("../src"); | ||
|
||
commander | ||
.usage('monorepo version <version>') | ||
.arguments('<version>') | ||
.option('-v, --verbose', 'Enable verbose log', (v, t) => t + 1, 0) | ||
.usage("monorepo version <version>") | ||
.arguments("<version>") | ||
.option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0) | ||
.action((version) => { | ||
|
||
runCommand(commands.VersionCmd, { | ||
version, | ||
verbose: !!commander.opts().verbose | ||
}) | ||
}); | ||
}) | ||
.parse(process.argv) | ||
|
||
|
||
.parse(process.argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
#!/usr/bin/env node | ||
|
||
const commander = require('commander') | ||
const cliPkg = require('../package.json') | ||
const commander = require("commander"); | ||
const cliPkg = require("../package.json"); | ||
|
||
commander | ||
.version(cliPkg.version) | ||
.command('ci <type>', 'Perform ci actions (configure)') | ||
.command('build <type>', 'Build artifacts (workspace, packages)') | ||
.command('clean <type>', 'Clean artifacts (workspace, docker)') | ||
.command('publish <type>', 'Publish artifacts (packages, examples, ghpages, docker, heroku)') | ||
.command('sync <type>', 'Perform synchronisation on given type (repository, packages, examples)') | ||
.command('version <version>', 'Update packages version') | ||
.parse(process.argv) | ||
.command("ci <type>", "Perform ci actions (configure)") | ||
.command("build <type>", "Build artifacts (workspace, packages)") | ||
.command("clean <type>", "Clean artifacts (workspace, docker)") | ||
.command("publish <type>", "Publish artifacts (packages, examples, ghpages, docker, heroku)") | ||
.command("sync <type>", "Perform synchronisation on given type (repository, packages, examples)") | ||
.command("version <version>", "Update packages version") | ||
.parse(process.argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
const { MonoRepo } = require('./src') | ||
const {MonoRepo} = require("./src"); | ||
|
||
let monoRepo | ||
let monoRepo; | ||
|
||
module.exports = { | ||
async verifyConditions (pluginConfig, context) { | ||
async verifyConditions(pluginConfig, context) { | ||
monoRepo = new MonoRepo({ | ||
rootDir: context.cwd | ||
}) | ||
}); | ||
|
||
await monoRepo.configureWorkspace({ | ||
dryRun: pluginConfig.dryRun | ||
}) | ||
}); | ||
}, | ||
|
||
async prepare (pluginConfig, context) { | ||
async prepare(pluginConfig, context) { | ||
const { | ||
nextRelease: { version } | ||
} = context | ||
nextRelease: {version} | ||
} = context; | ||
|
||
await monoRepo.newVersion({ version }) | ||
await monoRepo.build('workspace') | ||
await monoRepo.commitChanges({ version }) | ||
await monoRepo.newVersion({version}); | ||
await monoRepo.build("workspace"); | ||
await monoRepo.commitChanges({version}); | ||
}, | ||
|
||
async publish (pluginConfig) { | ||
return monoRepo.publish('packages', { dryRun: pluginConfig.dryRun }) | ||
async publish(pluginConfig) { | ||
return monoRepo.publish("packages", {dryRun: pluginConfig.dryRun}); | ||
}, | ||
|
||
async success (pluginConfig) { | ||
async success(pluginConfig) { | ||
if (!pluginConfig.dryRun) { | ||
return monoRepo.sync('repository') | ||
return monoRepo.sync("repository"); | ||
} | ||
} | ||
} | ||
}; |
Oops, something went wrong.