@jcoreio/toolchain 2.1.0 → 2.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcoreio/toolchain",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "base JS build toolchain",
5
5
  "repository": {
6
6
  "type": "git",
package/scripts/clean.cjs CHANGED
@@ -1,6 +1,8 @@
1
1
  const fs = require('../util/projectFs.cjs')
2
2
 
3
3
  exports.run = async function clean() {
4
- await fs.remove('dist')
4
+ await fs.emptyDir('dist').catch((err) => {
5
+ if (err.code !== 'ENOENT') throw err
6
+ })
5
7
  }
6
8
  exports.description = 'remove build output'
package/util/ChdirFs.cjs CHANGED
@@ -7,6 +7,9 @@ function ChdirFs(cwd) {
7
7
  fs.copy(resolve(cwd, src), resolve(cwd, dest), ...args),
8
8
  copySync: (src, dest, ...args) =>
9
9
  fs.copySync(resolve(cwd, src), resolve(cwd, dest), ...args),
10
+ emptyDir: (path, ...args) => fs.emptyDir(resolve(cwd, path), ...args),
11
+ emptyDirSync: (path, ...args) =>
12
+ fs.emptyDirSync(resolve(cwd, path), ...args),
10
13
  lstat: (path, ...args) => fs.lstat(resolve(cwd, path), ...args),
11
14
  stat: (path, ...args) => fs.stat(resolve(cwd, path), ...args),
12
15
  lstatSync: (path, ...args) => fs.lstatSync(resolve(cwd, path), ...args),