copy-folder-util 1.1.3 → 1.1.4

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/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # copy-folder-util
2
2
  <img src=https://centerkey.com/graphics/center-key-logo.svg align=right width=200 alt=logo>
3
3
 
4
- _Recursively copy files from one folder to another folder (CLI tool designed for use in npm scripts)_
4
+ _Recursively copy files from one folder to another folder (CLI tool designed for use in npm package.json scripts)_
5
5
 
6
6
  [![License:MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/center-key/copy-folder-util/blob/main/LICENSE.txt)
7
7
  [![npm](https://img.shields.io/npm/v/copy-folder-util.svg)](https://www.npmjs.com/package/copy-folder-util)
8
- [![Build](https://github.com/center-key/copy-folder-util/workflows/build/badge.svg)](https://github.com/center-key/copy-folder-util/actions/workflows/run-spec-on-push.yaml)
8
+ [![Build](https://github.com/center-key/copy-folder-util/actions/workflows/run-spec-on-push.yaml/badge.svg)](https://github.com/center-key/copy-folder-util/actions/workflows/run-spec-on-push.yaml)
9
9
 
10
10
  **copy-folder-util** takes a source folder and copies its files and subfolders to a new destination.&nbsp;
11
11
  The command's console output includes a timestamp and formatting helpful in build systems.
@@ -20,7 +20,7 @@ $ npm install --save-dev copy-folder-util
20
20
  ```
21
21
 
22
22
  ## B) Usage
23
- ### 1. npm scripts
23
+ ### 1. npm package.json scripts
24
24
  Run `copy-folder` from the `"scripts"` section of your **package.json** file.
25
25
 
26
26
  Parameters:
@@ -96,7 +96,7 @@ See the **TypeScript Declarations** at the top of [copy-folder.ts](copy-folder.t
96
96
  - 🪺 [recursive-exec](https://github.com/center-key/recursive-exec):&nbsp; _Run a command on each file in a folder and its subfolders_
97
97
  - 🔍 [replacer-util](https://github.com/center-key/replacer-util):&nbsp; _Find and replace strings or template outputs in text files_
98
98
  - 🔢 [rev-web-assets](https://github.com/center-key/rev-web-assets):&nbsp; _Revision web asset filenames with cache busting content hash fingerprints_
99
- - 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util):&nbsp; _Organize npm scripts into named groups of easy to manage commands_
99
+ - 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util):&nbsp; _Organize npm package.json scripts into groups of easy to manage commands_
100
100
  - 🚦 [w3c-html-validator](https://github.com/center-key/w3c-html-validator):&nbsp; _Check the markup validity of HTML files using the W3C validator_
101
101
 
102
102
  Feel free to submit questions at:<br>
package/bin/cli.js CHANGED
@@ -38,7 +38,7 @@ const error =
38
38
  cli.paramsCount > 2 ? 'Extraneous parameter: ' + cli.params[2] :
39
39
  null;
40
40
  if (error)
41
- throw Error('[copy-folder-util] ' + error);
41
+ throw new Error('[copy-folder-util] ' + error);
42
42
  const options = {
43
43
  cd: cli.flagMap.cd ?? null,
44
44
  fileExtensions: cli.flagMap.ext?.split(',') ?? [],
@@ -1,4 +1,4 @@
1
- //! copy-folder-util v1.1.3 ~~ https://github.com/center-key/copy-folder-util ~~ MIT License
1
+ //! copy-folder-util v1.1.4 ~~ https://github.com/center-key/copy-folder-util ~~ MIT License
2
2
 
3
3
  export type Settings = {
4
4
  basename: string;
@@ -1,4 +1,4 @@
1
- //! copy-folder-util v1.1.3 ~~ https://github.com/center-key/copy-folder-util ~~ MIT License
1
+ //! copy-folder-util v1.1.4 ~~ https://github.com/center-key/copy-folder-util ~~ MIT License
2
2
 
3
3
  import chalk from 'chalk';
4
4
  import fs from 'fs';
@@ -30,10 +30,10 @@ const copyFolder = {
30
30
  !fs.statSync(target).isDirectory() ? 'Target is not a folder: ' + target :
31
31
  null;
32
32
  if (errorMessage)
33
- throw Error('[copy-folder-util] ' + errorMessage);
33
+ throw new Error('[copy-folder-util] ' + errorMessage);
34
34
  const filterOff = {
35
35
  base: !settings.basename,
36
- ext: !settings.fileExtensions || settings.fileExtensions.length === 0,
36
+ ext: !Array.isArray(settings.fileExtensions) || !settings.fileExtensions.length,
37
37
  };
38
38
  const files = [];
39
39
  const posixPath = (nativePath) => slash(nativePath.replace(/.*:/, ''));
package/package.json CHANGED
@@ -1,21 +1,15 @@
1
1
  {
2
2
  "name": "copy-folder-util",
3
- "version": "1.1.3",
4
- "description": "Recursively copy files from one folder to another folder (CLI tool designed for use in npm scripts)",
3
+ "version": "1.1.4",
4
+ "description": "Recursively copy files from one folder to another folder (CLI tool designed for use in npm package.json scripts)",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "module": "dist/copy-folder.js",
8
- "main": "dist/copy-folder.js",
9
8
  "types": "dist/copy-folder.d.ts",
9
+ "exports": "./dist/copy-folder.js",
10
10
  "files": [
11
11
  "dist"
12
12
  ],
13
- "exports": {
14
- ".": {
15
- "import": "./dist/copy-folder.js"
16
- },
17
- "./": "./dist/"
18
- },
19
13
  "bin": {
20
14
  "copy-folder": "bin/cli.js",
21
15
  "copy-folder-util": "bin/cli.js"
@@ -49,32 +43,13 @@
49
43
  "node": true,
50
44
  "mocha": true
51
45
  },
52
- "eslintConfig": {
53
- "ignorePatterns": [
54
- "build",
55
- "dist",
56
- "node_modules"
57
- ],
58
- "root": true,
59
- "parser": "@typescript-eslint/parser",
60
- "plugins": [
61
- "@typescript-eslint"
62
- ],
63
- "extends": [
64
- "eslint:recommended",
65
- "plugin:@typescript-eslint/recommended"
66
- ],
67
- "rules": {
68
- "@typescript-eslint/no-non-null-assertion": "off"
69
- }
70
- },
71
46
  "runScriptsConfig": {
72
47
  "clean": [
73
48
  "rimraf build dist spec/fixtures/target"
74
49
  ],
75
50
  "lint": [
76
51
  "jshint . --exclude-path .gitignore",
77
- "eslint --max-warnings 0 . --ext .ts"
52
+ "eslint --max-warnings 0"
78
53
  ],
79
54
  "build": [
80
55
  "tsc",
@@ -92,18 +67,18 @@
92
67
  "slash": "~5.1"
93
68
  },
94
69
  "devDependencies": {
70
+ "@eslint/js": "~9.9",
95
71
  "@types/fancy-log": "~2.0",
96
- "@types/node": "~20.10",
97
- "@typescript-eslint/eslint-plugin": "~6.17",
98
- "@typescript-eslint/parser": "~6.17",
99
- "add-dist-header": "~1.3",
100
- "assert-deep-strict-equal": "~1.1",
101
- "copy-file-util": "~1.1",
102
- "eslint": "~8.56",
72
+ "@types/node": "~22.3",
73
+ "add-dist-header": "~1.4",
74
+ "assert-deep-strict-equal": "~1.2",
75
+ "copy-file-util": "~1.2",
76
+ "eslint": "~9.9",
103
77
  "jshint": "~2.13",
104
- "mocha": "~10.2",
105
- "rimraf": "~5.0",
106
- "run-scripts-util": "~1.2",
107
- "typescript": "~5.3"
78
+ "mocha": "~10.7",
79
+ "rimraf": "~6.0",
80
+ "run-scripts-util": "~1.3",
81
+ "typescript": "~5.5",
82
+ "typescript-eslint": "~8.1"
108
83
  }
109
84
  }