Skip to content

Commit a8fcfb8

Browse files
committed
refactor: move source files to dist/ folder
BREAKING CHANGE: JavaScript files moved from project root into dist/ folder. If you are defining a relative root path via --root option please prepend a ../ to it.
1 parent be2b900 commit a8fcfb8

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

cli.js renamed to dist/cli.js

File renamed without changes.

index.js renamed to dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const path = require('path');
55
const colors = require('colors/safe');
66
const fs = require('fs');
77
const argv = require('yargs').argv;
8-
let rootPath = path.join('..', '..', '..');
8+
let rootPath = path.join('..', '..', '..', '..');
99
if (argv.hasOwnProperty('root')) {
1010
rootPath = argv.root;
1111
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"name": "@saithodev/ts-appversion",
33
"version": "1.3.0",
44
"description": "Reads the version from your packages.json and saves it in a .ts file you can include into your application.",
5-
"main": "index.js",
5+
"main": "dist/index.js",
66
"bin": {
7-
"ts-appversion": "cli.js"
7+
"ts-appversion": "dist/cli.js"
88
},
99
"scripts": {
10-
"start": "node index.js",
10+
"start": "node dist/index.js",
1111
"test": "nyc --reporter=text --reporter=lcov mocha",
1212
"snyk-protect": "snyk protect",
1313
"prepare": "npm run snyk-protect",

sonar-project.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ sonar.links.ci=https://travis-ci.com/saitho/ng-appversion
1010
sonar.links.scm=https://github.com/saitho/ng-appversion
1111
sonar.links.issue=https://github.com/saitho/ng-appversion/issues
1212

13+
sonar.sources=dist
1314
sonar.tests=test
1415

1516
sonar.javascript.lcov.reportPaths=coverage/lcov.info

test/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ before(function() {
2222

2323
describe('appversion', function() {
2424
it('should skip when no package.json is found.', function(done) {
25-
exec('node index.js --root=' + repoDir + ' --file=version-test.ts', (err, stdout, stderr) => {
25+
exec('node dist/index.js --root=' + repoDir + ' --file=version-test.ts', (err, stdout, stderr) => {
2626
if (err) {
2727
done('Test failed: Could not execute command.');
2828
return;
@@ -39,7 +39,7 @@ describe('appversion', function() {
3939
it('should succeed with default settings and without a Git repository', function(done) {
4040
fs.mkdirSync(path.join(repoDir, 'src'), {recursive: true});
4141
fs.writeFileSync(path.join(repoDir, 'package.json'), '{"version": "1.0.0"}');
42-
exec('node index.js --root=' + repoDir, (err, stdout, stderr) => {
42+
exec('node dist/index.js --root=' + repoDir, (err, stdout, stderr) => {
4343
if (err) {
4444
done('Test failed: Could not execute command.');
4545
return;
@@ -65,7 +65,7 @@ describe('appversion', function() {
6565
repo.init();
6666
fs.mkdirSync(path.join(repoDir, 'src'));
6767
fs.writeFileSync(path.join(repoDir, 'package.json'), '{"version": "1.0.0"}');
68-
exec('node index.js --root=' + repoDir, (err, stdout, stderr) => {
68+
exec('node dist/index.js --root=' + repoDir, (err, stdout, stderr) => {
6969
if (err) {
7070
done('Test failed: Could not execute command.');
7171
return;
@@ -92,7 +92,7 @@ describe('appversion', function() {
9292
it('should succeed with different file output', function(done) {
9393
repo.init();
9494
fs.writeFileSync(path.join(repoDir, 'package.json'), '{"version": "1.0.0"}');
95-
exec('node index.js --root=' + repoDir + ' --file=version-test.ts', (err, stdout, stderr) => {
95+
exec('node dist/index.js --root=' + repoDir + ' --file=version-test.ts', (err, stdout, stderr) => {
9696
if (err) {
9797
done('Test failed: Could not execute command.');
9898
return;
@@ -121,7 +121,7 @@ describe('appversion', function() {
121121
fs.mkdirSync(applicationDir);
122122
fs.mkdirSync(path.join(applicationDir, 'src'));
123123
fs.writeFileSync(path.join(applicationDir, 'package.json'), '{"version": "1.0.0"}');
124-
exec('node index.js --root=' + applicationDir + ' --git=..', (err, stdout, stderr) => {
124+
exec('node dist/index.js --root=' + applicationDir + ' --git=..', (err, stdout, stderr) => {
125125
if (err) {
126126
done('Test failed: Could not execute command.');
127127
return;

0 commit comments

Comments
 (0)