@vamship/build-utils 1.3.0 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vamship/build-utils",
3
- "version": "1.3.0",
3
+ "version": "1.4.2",
4
4
  "description": "Utility library for build tooling",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -43,26 +43,26 @@
43
43
  "devDependencies": {
44
44
  "chai": "^4.3.6",
45
45
  "chai-as-promised": "^7.1.1",
46
- "eslint": "^8.10.0",
46
+ "eslint": "^8.18.0",
47
47
  "jsdoc": "^3.6.10",
48
- "mocha": "^9.2.2",
49
- "nodemon": "^2.0.15",
48
+ "mocha": "^10.0.0",
49
+ "nodemon": "^2.0.18",
50
50
  "nyc": "^15.1.0",
51
- "prettier": "^2.5.1",
51
+ "prettier": "^2.7.1",
52
52
  "rewire": "^6.0.0",
53
- "sinon": "^13.0.1",
53
+ "sinon": "^14.0.0",
54
54
  "sinon-chai": "^3.7.0"
55
55
  },
56
56
  "dependencies": {
57
57
  "camelcase": "^6.3.0",
58
58
  "delete": "^1.1.0",
59
59
  "docdash": "^1.2.0",
60
- "dotenv": "^16.0.0",
61
- "dotenv-expand": "^8.0.2",
62
- "execa": "^5.1.1",
60
+ "dotenv": "^16.0.1",
61
+ "dotenv-expand": "^8.0.3",
62
+ "execa": "^6.1.0",
63
63
  "fancy-log": "^2.0.0",
64
64
  "mkdirp": "^1.0.4",
65
- "semver": "^7.3.5"
65
+ "semver": "^7.3.7"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "@typescript-eslint/eslint-plugin": ">= 5.1.0",
@@ -82,8 +82,8 @@
82
82
  },
83
83
  "optionalDependencies": {
84
84
  "gulp-jsdoc3": "= 3.0.0",
85
- "typedoc": ">=0.22.13",
86
- "typescript": ">=4.6.2"
85
+ "typedoc": ">=0.23.2",
86
+ "typescript": ">=4.7.4"
87
87
  },
88
88
  "engines": {
89
89
  "node": ">= 14.18.1",
package/src/project.js CHANGED
@@ -122,6 +122,7 @@ module.exports = class Project {
122
122
  requiredEnv,
123
123
  exportedTypes,
124
124
  aws,
125
+ staticFilePatterns,
125
126
  } = buildMetadata;
126
127
 
127
128
  if (SUPPORTED_PROJECT_TYPES.indexOf(projectType) < 0) {
@@ -144,6 +145,8 @@ module.exports = class Project {
144
145
  this._projectType = projectType;
145
146
  this._language = language;
146
147
  this._exportedTypes = exportedTypes;
148
+ this._staticFilePatterns =
149
+ staticFilePatterns instanceof Array ? staticFilePatterns : [];
147
150
 
148
151
  this._hasTypescript = this._language === 'ts';
149
152
  this._hasServer = this._projectType === 'api';
@@ -439,6 +442,16 @@ module.exports = class Project {
439
442
  return this._exportedTypes;
440
443
  }
441
444
 
445
+ /**
446
+ * Additional files to copy from the source directory to the build
447
+ * directory.
448
+ *
449
+ * @return {String}
450
+ */
451
+ get staticFilePatterns() {
452
+ return this._staticFilePatterns;
453
+ }
454
+
442
455
  /**
443
456
  * Determines whether or not the project can be packaged up as a docker
444
457
  * image.
@@ -491,7 +504,9 @@ module.exports = class Project {
491
504
  }
492
505
  envFiles
493
506
  .filter((file) => _fs.existsSync(file))
494
- .forEach((file) => _dotEnvExpand(_dotEnv.config({ path: file })));
507
+ .forEach((file) =>
508
+ _dotEnvExpand.expand(_dotEnv.config({ path: file }))
509
+ );
495
510
  }
496
511
 
497
512
  /**
@@ -36,9 +36,13 @@ module.exports = (project, options) => {
36
36
  extras.push('Dockerfile*');
37
37
  }
38
38
 
39
+ const staticFilePatterns = ['js', 'json'].concat(
40
+ project.staticFilePatterns
41
+ );
42
+
39
43
  const paths = dirs
40
44
  .map((dir) => rootDir.getChild(dir))
41
- .map((dir) => ['js', 'json'].map((ext) => dir.getAllFilesGlob(ext)))
45
+ .map((dir) => staticFilePatterns.map((ext) => dir.getAllFilesGlob(ext)))
42
46
  .reduce((result, arr) => result.concat(arr), [])
43
47
  .concat(extras.map((item) => rootDir.getFileGlob(item)));
44
48