@videinfra/static-website-builder 1.4.2 → 1.4.3

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/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [1.4.3] - 2022-03-08
8
+ ### Fixed
9
+ - Fixed negative glob paths not working
10
+
7
11
  ## [1.4.2] - 2021-08-27
8
12
  ### Fixed
9
13
  - Fixed postcss-ignore-plugin only removing and adding content in unrelated files
@@ -22,7 +22,10 @@ class GlobObject {
22
22
  if (this.pathsArr.length) {
23
23
  this.map((basePath) => {
24
24
  return pathsArr.map((subPath) => {
25
- return path.join(basePath, subPath);
25
+ // If subpath starts with specia character "!" then prepend that to the begining of full paths
26
+ const negativePath = subPath[0] === '!' ? '!' : '';
27
+ const subPathNormalized = negativePath ? subPath.substr(1) : subPath;
28
+ return negativePath + path.join(basePath, subPathNormalized);
26
29
  });
27
30
  });
28
31
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@videinfra/static-website-builder",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Customizable static site project builder",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -84,6 +84,11 @@ test('glob map', () => {
84
84
  expect(output2).toEqual(['/a/some/folder/b', '/a/other/folder/b']);
85
85
  });
86
86
 
87
+ test('glob negative', () => {
88
+ const output = glob.paths('/some/folder').paths('!/assets/**/*.*').generate();
89
+ expect(output).toEqual(['!/some/folder/assets/**/*.*']);
90
+ });
91
+
87
92
  test('glob generate', () => {
88
93
  const output = glob.generate(
89
94
  glob.paths(['/a', '/b']).allFiles(),