-
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: export configs from package (#93)
* refactor: move implicit starting point to src * feat: export configs from package * refactor: prettier requires the actual configuration * refactor: export command from module * refactor: simplify bundledConfigPaths * refactor: add comment explaining special case
- Loading branch information
Showing
13 changed files
with
111 additions
and
15 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
const { config } = require('./index.js') | ||
|
||
module.exports = { | ||
extends: ['./config/js/eslint.config.js'], | ||
extends: [config.eslint], | ||
} |
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
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 +1,5 @@ | ||
module.exports = require('./config/js/prettier.config.js') | ||
const { config } = require('./index.js') | ||
|
||
module.exports = { | ||
...require(config.prettier), | ||
} |
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,5 +1,5 @@ | ||
#!/usr/bin/env node | ||
const { makeEntryPoint } = require('@dhis2/cli-helpers-engine') | ||
const command = require('..') | ||
const command = require('../src') | ||
|
||
makeEntryPoint(command) |
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,3 +1,5 @@ | ||
const { config } = require('@dhis2/cli-style') | ||
|
||
module.exports = { | ||
extends: ['./node_modules/@dhis2/cli-style/config/js/eslint.config.js'], | ||
extends: [config.eslint], | ||
} |
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,3 +1,5 @@ | ||
const { config } = require('@dhis2/cli-style') | ||
|
||
module.exports = { | ||
...require('@dhis2/cli-style/config/js/prettier.config.js'), | ||
...require(config.prettier), | ||
} |
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,9 +1,5 @@ | ||
const { namespace } = require('@dhis2/cli-helpers-engine') | ||
const { bundledConfigPaths } = require('./src/groups.js') | ||
const command = require('./src/index.js') | ||
|
||
const command = namespace('style', { | ||
desc: 'DHIS2 programmatic style for commit msgs/code', | ||
aliases: 's', | ||
builder: require('./src/cmds.js'), | ||
}) | ||
|
||
module.exports = command | ||
exports.config = bundledConfigPaths() | ||
exports.command = command |
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
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,9 @@ | ||
const { namespace } = require('@dhis2/cli-helpers-engine') | ||
|
||
const command = namespace('style', { | ||
desc: 'DHIS2 programmatic style for commit msgs/code', | ||
aliases: 's', | ||
builder: require('./cmds.js'), | ||
}) | ||
|
||
module.exports = command |
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,10 @@ | ||
const test = require('tape') | ||
|
||
const { command, config } = require('../index.js') | ||
|
||
test('base exports are objects', t => { | ||
t.plan(2) | ||
|
||
t.ok(typeof command === 'object') | ||
t.ok(typeof config === 'object') | ||
}) |