@awesomeness-js/utils 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.js CHANGED
@@ -2,5 +2,5 @@ import build from './src/build.js';
2
2
 
3
3
  build({
4
4
  src: './src',
5
- dest: ['./', 'index.js']
5
+ dest: './index.js'
6
6
  });
package/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * It consolidates API functions for use in the application.
4
4
  * Do not edit manually.
5
5
  */
6
- import _build from './build.js';
6
+ import _build from './src/build.js';
7
7
 
8
8
  export default {
9
9
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awesomeness-js/utils",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Awesomeness - Utils",
5
5
  "repository": {
6
6
  "type": "git",
package/src/build.js CHANGED
@@ -10,6 +10,7 @@ import { join, sep } from 'path';
10
10
  * @returns {bool} - Returns true if the output file is generated successfully.
11
11
  */
12
12
 
13
+
13
14
  function getAllFiles(base, dir, files = []) {
14
15
  const directory = join(base, dir);
15
16
  let sortedFiles = readdirSync(directory).sort();
@@ -78,7 +79,7 @@ function generateExports(src) {
78
79
  const parts = file.split(sep).filter(p => p !== '.');
79
80
  const functionName = parts.pop().replace('.js', '');
80
81
  const namespace = parts.join('_');
81
- const importPath = './' + file.replace(/\.js$/, '').replace(/\\/g, '/');
82
+ const importPath = src + '/' + file.replace(/\.js$/, '').replace(/\\/g, '/');
82
83
  const filePath = join(src, file);
83
84
 
84
85
  // Extract JSDoc comment, if present
@@ -118,10 +119,10 @@ function generateExports(src) {
118
119
 
119
120
  async function build({
120
121
  src = './src',
121
- dest = ['./', 'index.js']
122
+ dest = './index.js'
122
123
  } = {}) {
123
124
  const indexContent = generateExports(src);
124
- writeFileSync(join(...dest), indexContent);
125
+ writeFileSync(dest, indexContent);
125
126
  return true;
126
127
  }
127
128