Skip to content

Commit

Permalink
perf: Exclude unnecessary files from npm publish
Browse files Browse the repository at this point in the history
* Included only necessary files through "files" property in package.json
* Moved config/*, lib/* and bin/* files into src directory

closes #13
  • Loading branch information
m-sureshraj committed Dec 31, 2019
1 parent cdb85e9 commit c20a2ec
Show file tree
Hide file tree
Showing 19 changed files with 22 additions and 21 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"version": "0.2.6",
"description": "CLI tool to interact with Jenkins server",
"bin": {
"jen": "./bin/jen.js"
"jen": "src/bin/jen.js"
},
"engines": {
"node": ">=8.12"
},
"files": ["src", "!src/**/*.spec.js"],
"scripts": {
"test": "jest",
"test:watch": "jest --watch",
Expand Down
4 changes: 2 additions & 2 deletions bin/jen.js β†’ src/bin/jen.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

const jen = require('commander');

const pkg = require('../package.json');
const run = require('../src');
const pkg = require('../../package.json');
const run = require('../index');
const { debug } = require('../lib/log');
const { COMMAND } = require('../config');

Expand Down
8 changes: 4 additions & 4 deletions src/commands/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ const path = require('path');
const Conf = require('conf');
const { yellow, gray, red, green } = require('kleur');

const { getGitRootDirPath } = require('../../lib/git-cmd');
const { printConfig } = require('../../lib/cli-table');
const { isValidUrl } = require('../../lib/util');
const { debug } = require('../../lib/log');
const { getGitRootDirPath } = require('../lib/git-cmd');
const { printConfig } = require('../lib/cli-table');
const { isValidUrl } = require('../lib/util');
const { debug } = require('../lib/log');

const store = new Conf();

Expand Down
2 changes: 1 addition & 1 deletion src/commands/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { COMMAND } = require('../../config');
const { COMMAND } = require('../config');

module.exports = {
[COMMAND.init]: require('./init'),
Expand Down
6 changes: 3 additions & 3 deletions src/commands/init.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const Conf = require('conf');
const { green, gray, red } = require('kleur');

const { getGitRootDirPath } = require('../../lib/git-cmd');
const { requestJenkinsCredentials, askConfirmation } = require('../../lib/prompt');
const { printConfig } = require('../../lib/cli-table');
const { getGitRootDirPath } = require('../lib/git-cmd');
const { requestJenkinsCredentials, askConfirmation } = require('../lib/prompt');
const { printConfig } = require('../lib/cli-table');

const store = new Conf();

Expand Down
6 changes: 3 additions & 3 deletions src/commands/open.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const _open = require('open');

const { getCurrentBranchName } = require('../../lib/git-cmd');
const { getJobLink } = require('../../lib/jenkins');
const { debug } = require('../../lib/log');
const { getCurrentBranchName } = require('../lib/git-cmd');
const { getJobLink } = require('../lib/jenkins');
const { debug } = require('../lib/log');

module.exports = function open(buildNumber = null) {
const branchName = getCurrentBranchName();
Expand Down
8 changes: 4 additions & 4 deletions src/commands/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ const ora = require('ora');
const { yellow, gray, red } = require('kleur');
const terminalLink = require('terminal-link');

const { getCurrentBranchName } = require('../../lib/git-cmd');
const { getCurrentBranchName } = require('../lib/git-cmd');
const {
getBranchBuildHistory,
getJobLink,
constructJobTitle,
} = require('../../lib/jenkins');
const { printBuildHistory } = require('../../lib/cli-table');
const { logNetworkErrors, debug } = require('../../lib/log');
} = require('../lib/jenkins');
const { printBuildHistory } = require('../lib/cli-table');
const { logNetworkErrors, debug } = require('../lib/log');

const spinner = ora();

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const Conf = require('conf');
const { yellow, blue, bold } = require('kleur');

const { isGitRepository, getGitRootDirPath } = require('../lib/git-cmd');
const { COMMAND } = require('../config');
const { debug } = require('../lib/log');
const { isGitRepository, getGitRootDirPath } = require('./lib/git-cmd');
const { COMMAND } = require('./config');
const { debug } = require('./lib/log');
const commands = require('./commands');

const store = new Conf();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c20a2ec

Please sign in to comment.