@tachybase/plugin-block-charts 0.23.8

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.
Files changed (115) hide show
  1. package/.turbo/turbo-build.log +9 -0
  2. package/README.md +88 -0
  3. package/client.d.ts +3 -0
  4. package/client.js +65 -0
  5. package/dist/client/block/ChartBlock.d.ts +2 -0
  6. package/dist/client/block/ChartBlockDesigner.d.ts +2 -0
  7. package/dist/client/block/ChartBlockInitializer.d.ts +4 -0
  8. package/dist/client/block/ChartDataProvider.d.ts +16 -0
  9. package/dist/client/block/formatters.d.ts +15 -0
  10. package/dist/client/block/index.d.ts +3 -0
  11. package/dist/client/block/transformers.d.ts +10 -0
  12. package/dist/client/chart/antd/GroupedTable.d.ts +6 -0
  13. package/dist/client/chart/antd/antd.d.ts +7 -0
  14. package/dist/client/chart/antd/index.d.ts +5 -0
  15. package/dist/client/chart/antd/statistic.d.ts +7 -0
  16. package/dist/client/chart/antd/table.d.ts +6 -0
  17. package/dist/client/chart/chart.d.ts +77 -0
  18. package/dist/client/chart/configs.d.ts +79 -0
  19. package/dist/client/chart/g2plot/AntChart.d.ts +2 -0
  20. package/dist/client/chart/g2plot/bar.d.ts +6 -0
  21. package/dist/client/chart/g2plot/configs.d.ts +40 -0
  22. package/dist/client/chart/g2plot/dualAxes.d.ts +7 -0
  23. package/dist/client/chart/g2plot/g2plot.d.ts +10 -0
  24. package/dist/client/chart/g2plot/index.d.ts +3 -0
  25. package/dist/client/chart/g2plot/pie.d.ts +7 -0
  26. package/dist/client/chart/group.d.ts +32 -0
  27. package/dist/client/configure/ChartConfigProvider.d.ts +18 -0
  28. package/dist/client/configure/ChartConfigure.d.ts +18 -0
  29. package/dist/client/configure/FilterDynamicComponent.d.ts +2 -0
  30. package/dist/client/configure/index.d.ts +2 -0
  31. package/dist/client/configure/schemas/configure.d.ts +4 -0
  32. package/dist/client/filter/CollectionFieldInitializer.d.ts +2 -0
  33. package/dist/client/filter/FilterActionInitializers.d.ts +15 -0
  34. package/dist/client/filter/FilterBlockDesigner.d.ts +2 -0
  35. package/dist/client/filter/FilterBlockInitializer.d.ts +3 -0
  36. package/dist/client/filter/FilterBlockProvider.d.ts +2 -0
  37. package/dist/client/filter/FilterCheckbox.d.ts +2 -0
  38. package/dist/client/filter/FilterForm.d.ts +2 -0
  39. package/dist/client/filter/FilterItemDesigner.d.ts +2 -0
  40. package/dist/client/filter/FilterItemInitializers.d.ts +7 -0
  41. package/dist/client/filter/FilterProvider.d.ts +30 -0
  42. package/dist/client/filter/FilterVariableInput.d.ts +2 -0
  43. package/dist/client/filter/index.d.ts +6 -0
  44. package/dist/client/filter/utils.d.ts +59 -0
  45. package/dist/client/hooks/filter.d.ts +225 -0
  46. package/dist/client/hooks/index.d.ts +4 -0
  47. package/dist/client/hooks/query.d.ts +52 -0
  48. package/dist/client/hooks/transformer.d.ts +12 -0
  49. package/dist/client/hooks/useDateVariable.d.ts +14 -0
  50. package/dist/client/hooks/useUserVariable.d.ts +8 -0
  51. package/dist/client/hooks/useVariableOptions.d.ts +10 -0
  52. package/dist/client/index.d.ts +13 -0
  53. package/dist/client/index.js +234 -0
  54. package/dist/client/locale/index.d.ts +3 -0
  55. package/dist/client/renderer/ChartRenderer.d.ts +4 -0
  56. package/dist/client/renderer/ChartRendererProvider.d.ts +49 -0
  57. package/dist/client/renderer/index.d.ts +2 -0
  58. package/dist/client/utils.d.ts +44 -0
  59. package/dist/externalVersion.js +18 -0
  60. package/dist/index.d.ts +2 -0
  61. package/dist/index.js +39 -0
  62. package/dist/locale/en-US.json +89 -0
  63. package/dist/locale/ko_KR.json +85 -0
  64. package/dist/locale/zh-CN.json +90 -0
  65. package/dist/node_modules/fs-extra/LICENSE +15 -0
  66. package/dist/node_modules/fs-extra/lib/copy/copy-sync.js +161 -0
  67. package/dist/node_modules/fs-extra/lib/copy/copy.js +177 -0
  68. package/dist/node_modules/fs-extra/lib/copy/index.js +7 -0
  69. package/dist/node_modules/fs-extra/lib/empty/index.js +39 -0
  70. package/dist/node_modules/fs-extra/lib/ensure/file.js +66 -0
  71. package/dist/node_modules/fs-extra/lib/ensure/index.js +23 -0
  72. package/dist/node_modules/fs-extra/lib/ensure/link.js +64 -0
  73. package/dist/node_modules/fs-extra/lib/ensure/symlink-paths.js +101 -0
  74. package/dist/node_modules/fs-extra/lib/ensure/symlink-type.js +34 -0
  75. package/dist/node_modules/fs-extra/lib/ensure/symlink.js +67 -0
  76. package/dist/node_modules/fs-extra/lib/fs/index.js +140 -0
  77. package/dist/node_modules/fs-extra/lib/index.js +1 -0
  78. package/dist/node_modules/fs-extra/lib/json/index.js +16 -0
  79. package/dist/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
  80. package/dist/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
  81. package/dist/node_modules/fs-extra/lib/json/output-json.js +12 -0
  82. package/dist/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
  83. package/dist/node_modules/fs-extra/lib/mkdirs/make-dir.js +27 -0
  84. package/dist/node_modules/fs-extra/lib/mkdirs/utils.js +21 -0
  85. package/dist/node_modules/fs-extra/lib/move/index.js +7 -0
  86. package/dist/node_modules/fs-extra/lib/move/move-sync.js +55 -0
  87. package/dist/node_modules/fs-extra/lib/move/move.js +59 -0
  88. package/dist/node_modules/fs-extra/lib/output-file/index.js +31 -0
  89. package/dist/node_modules/fs-extra/lib/path-exists/index.js +12 -0
  90. package/dist/node_modules/fs-extra/lib/remove/index.js +17 -0
  91. package/dist/node_modules/fs-extra/lib/util/stat.js +158 -0
  92. package/dist/node_modules/fs-extra/lib/util/utimes.js +36 -0
  93. package/dist/node_modules/fs-extra/package.json +1 -0
  94. package/dist/node_modules/koa-compose/index.js +1 -0
  95. package/dist/node_modules/koa-compose/package.json +1 -0
  96. package/dist/server/actions/formatter.d.ts +4 -0
  97. package/dist/server/actions/formatter.js +67 -0
  98. package/dist/server/actions/query.d.ts +8 -0
  99. package/dist/server/actions/query.js +320 -0
  100. package/dist/server/index.d.ts +1 -0
  101. package/dist/server/index.js +33 -0
  102. package/dist/server/migrations/20230926211750-rename-charttype.d.ts +5 -0
  103. package/dist/server/migrations/20230926211750-rename-charttype.js +51 -0
  104. package/dist/server/plugin.d.ts +13 -0
  105. package/dist/server/plugin.js +83 -0
  106. package/dist/server/services/sql-loader.d.ts +10 -0
  107. package/dist/server/services/sql-loader.js +134 -0
  108. package/dist/server/sqls/view_load_function.sql +17 -0
  109. package/dist/server/utils/multiprocess.d.ts +2 -0
  110. package/dist/server/utils/multiprocess.js +38 -0
  111. package/dist/swagger/index.d.ts +8 -0
  112. package/dist/swagger/index.js +29 -0
  113. package/package.json +44 -0
  114. package/server.d.ts +3 -0
  115. package/server.js +65 -0
@@ -0,0 +1,140 @@
1
+ 'use strict'
2
+ // This is adapted from https://github.com/normalize/mz
3
+ // Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors
4
+ const u = require('universalify').fromCallback
5
+ const fs = require('graceful-fs')
6
+
7
+ const api = [
8
+ 'access',
9
+ 'appendFile',
10
+ 'chmod',
11
+ 'chown',
12
+ 'close',
13
+ 'copyFile',
14
+ 'fchmod',
15
+ 'fchown',
16
+ 'fdatasync',
17
+ 'fstat',
18
+ 'fsync',
19
+ 'ftruncate',
20
+ 'futimes',
21
+ 'lchmod',
22
+ 'lchown',
23
+ 'link',
24
+ 'lstat',
25
+ 'mkdir',
26
+ 'mkdtemp',
27
+ 'open',
28
+ 'opendir',
29
+ 'readdir',
30
+ 'readFile',
31
+ 'readlink',
32
+ 'realpath',
33
+ 'rename',
34
+ 'rm',
35
+ 'rmdir',
36
+ 'stat',
37
+ 'symlink',
38
+ 'truncate',
39
+ 'unlink',
40
+ 'utimes',
41
+ 'writeFile'
42
+ ].filter(key => {
43
+ // Some commands are not available on some systems. Ex:
44
+ // fs.cp was added in Node.js v16.7.0
45
+ // fs.lchown is not available on at least some Linux
46
+ return typeof fs[key] === 'function'
47
+ })
48
+
49
+ // Export cloned fs:
50
+ Object.assign(exports, fs)
51
+
52
+ // Universalify async methods:
53
+ api.forEach(method => {
54
+ exports[method] = u(fs[method])
55
+ })
56
+
57
+ // We differ from mz/fs in that we still ship the old, broken, fs.exists()
58
+ // since we are a drop-in replacement for the native module
59
+ exports.exists = function (filename, callback) {
60
+ if (typeof callback === 'function') {
61
+ return fs.exists(filename, callback)
62
+ }
63
+ return new Promise(resolve => {
64
+ return fs.exists(filename, resolve)
65
+ })
66
+ }
67
+
68
+ // fs.read(), fs.write(), fs.readv(), & fs.writev() need special treatment due to multiple callback args
69
+
70
+ exports.read = function (fd, buffer, offset, length, position, callback) {
71
+ if (typeof callback === 'function') {
72
+ return fs.read(fd, buffer, offset, length, position, callback)
73
+ }
74
+ return new Promise((resolve, reject) => {
75
+ fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {
76
+ if (err) return reject(err)
77
+ resolve({ bytesRead, buffer })
78
+ })
79
+ })
80
+ }
81
+
82
+ // Function signature can be
83
+ // fs.write(fd, buffer[, offset[, length[, position]]], callback)
84
+ // OR
85
+ // fs.write(fd, string[, position[, encoding]], callback)
86
+ // We need to handle both cases, so we use ...args
87
+ exports.write = function (fd, buffer, ...args) {
88
+ if (typeof args[args.length - 1] === 'function') {
89
+ return fs.write(fd, buffer, ...args)
90
+ }
91
+
92
+ return new Promise((resolve, reject) => {
93
+ fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {
94
+ if (err) return reject(err)
95
+ resolve({ bytesWritten, buffer })
96
+ })
97
+ })
98
+ }
99
+
100
+ // Function signature is
101
+ // s.readv(fd, buffers[, position], callback)
102
+ // We need to handle the optional arg, so we use ...args
103
+ exports.readv = function (fd, buffers, ...args) {
104
+ if (typeof args[args.length - 1] === 'function') {
105
+ return fs.readv(fd, buffers, ...args)
106
+ }
107
+
108
+ return new Promise((resolve, reject) => {
109
+ fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => {
110
+ if (err) return reject(err)
111
+ resolve({ bytesRead, buffers })
112
+ })
113
+ })
114
+ }
115
+
116
+ // Function signature is
117
+ // s.writev(fd, buffers[, position], callback)
118
+ // We need to handle the optional arg, so we use ...args
119
+ exports.writev = function (fd, buffers, ...args) {
120
+ if (typeof args[args.length - 1] === 'function') {
121
+ return fs.writev(fd, buffers, ...args)
122
+ }
123
+
124
+ return new Promise((resolve, reject) => {
125
+ fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
126
+ if (err) return reject(err)
127
+ resolve({ bytesWritten, buffers })
128
+ })
129
+ })
130
+ }
131
+
132
+ // fs.realpath.native sometimes not available if fs is monkey-patched
133
+ if (typeof fs.realpath.native === 'function') {
134
+ exports.realpath.native = u(fs.realpath.native)
135
+ } else {
136
+ process.emitWarning(
137
+ 'fs.realpath.native is not a function. Is fs being monkey-patched?',
138
+ 'Warning', 'fs-extra-WARN0003'
139
+ )
140
+ }
@@ -0,0 +1 @@
1
+ (function(){var t={533:function(t,e,n){"use strict";const r=n(551);const i=n(928);const o=n(923).mkdirsSync;const c=n(592).utimesMillisSync;const s=n(81);function copySync(t,e,n){if(typeof n==="function"){n={filter:n}}n=n||{};n.clobber="clobber"in n?!!n.clobber:true;n.overwrite="overwrite"in n?!!n.overwrite:n.clobber;if(n.preserveTimestamps&&process.arch==="ia32"){process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n"+"\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002")}const{srcStat:c,destStat:a}=s.checkPathsSync(t,e,"copy",n);s.checkParentPathsSync(t,c,e,"copy");if(n.filter&&!n.filter(t,e))return;const u=i.dirname(e);if(!r.existsSync(u))o(u);return getStats(a,t,e,n)}function getStats(t,e,n,i){const o=i.dereference?r.statSync:r.lstatSync;const c=o(e);if(c.isDirectory())return onDir(c,t,e,n,i);else if(c.isFile()||c.isCharacterDevice()||c.isBlockDevice())return onFile(c,t,e,n,i);else if(c.isSymbolicLink())return onLink(t,e,n,i);else if(c.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);else if(c.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function onFile(t,e,n,r,i){if(!e)return copyFile(t,n,r,i);return mayCopyFile(t,n,r,i)}function mayCopyFile(t,e,n,i){if(i.overwrite){r.unlinkSync(n);return copyFile(t,e,n,i)}else if(i.errorOnExist){throw new Error(`'${n}' already exists`)}}function copyFile(t,e,n,i){r.copyFileSync(e,n);if(i.preserveTimestamps)handleTimestamps(t.mode,e,n);return setDestMode(n,t.mode)}function handleTimestamps(t,e,n){if(fileIsNotWritable(t))makeFileWritable(n,t);return setDestTimestamps(e,n)}function fileIsNotWritable(t){return(t&128)===0}function makeFileWritable(t,e){return setDestMode(t,e|128)}function setDestMode(t,e){return r.chmodSync(t,e)}function setDestTimestamps(t,e){const n=r.statSync(t);return c(e,n.atime,n.mtime)}function onDir(t,e,n,r,i){if(!e)return mkDirAndCopy(t.mode,n,r,i);return copyDir(n,r,i)}function mkDirAndCopy(t,e,n,i){r.mkdirSync(n);copyDir(e,n,i);return setDestMode(n,t)}function copyDir(t,e,n){r.readdirSync(t).forEach((r=>copyDirItem(r,t,e,n)))}function copyDirItem(t,e,n,r){const o=i.join(e,t);const c=i.join(n,t);if(r.filter&&!r.filter(o,c))return;const{destStat:a}=s.checkPathsSync(o,c,"copy",r);return getStats(a,o,c,r)}function onLink(t,e,n,o){let c=r.readlinkSync(e);if(o.dereference){c=i.resolve(process.cwd(),c)}if(!t){return r.symlinkSync(c,n)}else{let t;try{t=r.readlinkSync(n)}catch(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return r.symlinkSync(c,n);throw t}if(o.dereference){t=i.resolve(process.cwd(),t)}if(s.isSrcSubdir(c,t)){throw new Error(`Cannot copy '${c}' to a subdirectory of itself, '${t}'.`)}if(s.isSrcSubdir(t,c)){throw new Error(`Cannot overwrite '${t}' with '${c}'.`)}return copyLink(c,n)}}function copyLink(t,e){r.unlinkSync(e);return r.symlinkSync(t,e)}t.exports=copySync},597:function(t,e,n){"use strict";const r=n(312);const i=n(928);const{mkdirs:o}=n(923);const{pathExists:c}=n(467);const{utimesMillis:s}=n(592);const a=n(81);async function copy(t,e,n={}){if(typeof n==="function"){n={filter:n}}n.clobber="clobber"in n?!!n.clobber:true;n.overwrite="overwrite"in n?!!n.overwrite:n.clobber;if(n.preserveTimestamps&&process.arch==="ia32"){process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n"+"\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001")}const{srcStat:r,destStat:s}=await a.checkPaths(t,e,"copy",n);await a.checkParentPaths(t,r,e,"copy");const u=await runFilter(t,e,n);if(!u)return;const f=i.dirname(e);const l=await c(f);if(!l){await o(f)}await getStatsAndPerformCopy(s,t,e,n)}async function runFilter(t,e,n){if(!n.filter)return true;return n.filter(t,e)}async function getStatsAndPerformCopy(t,e,n,i){const o=i.dereference?r.stat:r.lstat;const c=await o(e);if(c.isDirectory())return onDir(c,t,e,n,i);if(c.isFile()||c.isCharacterDevice()||c.isBlockDevice())return onFile(c,t,e,n,i);if(c.isSymbolicLink())return onLink(t,e,n,i);if(c.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(c.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}async function onFile(t,e,n,i,o){if(!e)return copyFile(t,n,i,o);if(o.overwrite){await r.unlink(i);return copyFile(t,n,i,o)}if(o.errorOnExist){throw new Error(`'${i}' already exists`)}}async function copyFile(t,e,n,i){await r.copyFile(e,n);if(i.preserveTimestamps){if(fileIsNotWritable(t.mode)){await makeFileWritable(n,t.mode)}const i=await r.stat(e);await s(n,i.atime,i.mtime)}return r.chmod(n,t.mode)}function fileIsNotWritable(t){return(t&128)===0}function makeFileWritable(t,e){return r.chmod(t,e|128)}async function onDir(t,e,n,o,c){if(!e){await r.mkdir(o)}const s=await r.readdir(n);await Promise.all(s.map((async t=>{const e=i.join(n,t);const r=i.join(o,t);const s=await runFilter(e,r,c);if(!s)return;const{destStat:u}=await a.checkPaths(e,r,"copy",c);return getStatsAndPerformCopy(u,e,r,c)})));if(!e){await r.chmod(o,t.mode)}}async function onLink(t,e,n,o){let c=await r.readlink(e);if(o.dereference){c=i.resolve(process.cwd(),c)}if(!t){return r.symlink(c,n)}let s=null;try{s=await r.readlink(n)}catch(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return r.symlink(c,n);throw t}if(o.dereference){s=i.resolve(process.cwd(),s)}if(a.isSrcSubdir(c,s)){throw new Error(`Cannot copy '${c}' to a subdirectory of itself, '${s}'.`)}if(a.isSrcSubdir(s,c)){throw new Error(`Cannot overwrite '${s}' with '${c}'.`)}await r.unlink(n);return r.symlink(c,n)}t.exports=copy},394:function(t,e,n){"use strict";const r=n(327).fromPromise;t.exports={copy:r(n(597)),copySync:n(533)}},60:function(t,e,n){"use strict";const r=n(327).fromPromise;const i=n(312);const o=n(928);const c=n(923);const s=n(887);const a=r((async function emptyDir(t){let e;try{e=await i.readdir(t)}catch{return c.mkdirs(t)}return Promise.all(e.map((e=>s.remove(o.join(t,e)))))}));function emptyDirSync(t){let e;try{e=i.readdirSync(t)}catch{return c.mkdirsSync(t)}e.forEach((e=>{e=o.join(t,e);s.removeSync(e)}))}t.exports={emptyDirSync:emptyDirSync,emptydirSync:emptyDirSync,emptyDir:a,emptydir:a}},111:function(t,e,n){"use strict";const r=n(327).fromPromise;const i=n(928);const o=n(312);const c=n(923);async function createFile(t){let e;try{e=await o.stat(t)}catch{}if(e&&e.isFile())return;const n=i.dirname(t);let r=null;try{r=await o.stat(n)}catch(e){if(e.code==="ENOENT"){await c.mkdirs(n);await o.writeFile(t,"");return}else{throw e}}if(r.isDirectory()){await o.writeFile(t,"")}else{await o.readdir(n)}}function createFileSync(t){let e;try{e=o.statSync(t)}catch{}if(e&&e.isFile())return;const n=i.dirname(t);try{if(!o.statSync(n).isDirectory()){o.readdirSync(n)}}catch(t){if(t&&t.code==="ENOENT")c.mkdirsSync(n);else throw t}o.writeFileSync(t,"")}t.exports={createFile:r(createFile),createFileSync:createFileSync}},845:function(t,e,n){"use strict";const{createFile:r,createFileSync:i}=n(111);const{createLink:o,createLinkSync:c}=n(825);const{createSymlink:s,createSymlinkSync:a}=n(554);t.exports={createFile:r,createFileSync:i,ensureFile:r,ensureFileSync:i,createLink:o,createLinkSync:c,ensureLink:o,ensureLinkSync:c,createSymlink:s,createSymlinkSync:a,ensureSymlink:s,ensureSymlinkSync:a}},825:function(t,e,n){"use strict";const r=n(327).fromPromise;const i=n(928);const o=n(312);const c=n(923);const{pathExists:s}=n(467);const{areIdentical:a}=n(81);async function createLink(t,e){let n;try{n=await o.lstat(e)}catch{}let r;try{r=await o.lstat(t)}catch(t){t.message=t.message.replace("lstat","ensureLink");throw t}if(n&&a(r,n))return;const u=i.dirname(e);const f=await s(u);if(!f){await c.mkdirs(u)}await o.link(t,e)}function createLinkSync(t,e){let n;try{n=o.lstatSync(e)}catch{}try{const e=o.lstatSync(t);if(n&&a(e,n))return}catch(t){t.message=t.message.replace("lstat","ensureLink");throw t}const r=i.dirname(e);const s=o.existsSync(r);if(s)return o.linkSync(t,e);c.mkdirsSync(r);return o.linkSync(t,e)}t.exports={createLink:r(createLink),createLinkSync:createLinkSync}},599:function(t,e,n){"use strict";const r=n(928);const i=n(312);const{pathExists:o}=n(467);const c=n(327).fromPromise;async function symlinkPaths(t,e){if(r.isAbsolute(t)){try{await i.lstat(t)}catch(t){t.message=t.message.replace("lstat","ensureSymlink");throw t}return{toCwd:t,toDst:t}}const n=r.dirname(e);const c=r.join(n,t);const s=await o(c);if(s){return{toCwd:c,toDst:t}}try{await i.lstat(t)}catch(t){t.message=t.message.replace("lstat","ensureSymlink");throw t}return{toCwd:t,toDst:r.relative(n,t)}}function symlinkPathsSync(t,e){if(r.isAbsolute(t)){const e=i.existsSync(t);if(!e)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}const n=r.dirname(e);const o=r.join(n,t);const c=i.existsSync(o);if(c){return{toCwd:o,toDst:t}}const s=i.existsSync(t);if(!s)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:r.relative(n,t)}}t.exports={symlinkPaths:c(symlinkPaths),symlinkPathsSync:symlinkPathsSync}},563:function(t,e,n){"use strict";const r=n(312);const i=n(327).fromPromise;async function symlinkType(t,e){if(e)return e;let n;try{n=await r.lstat(t)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}function symlinkTypeSync(t,e){if(e)return e;let n;try{n=r.lstatSync(t)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}t.exports={symlinkType:i(symlinkType),symlinkTypeSync:symlinkTypeSync}},554:function(t,e,n){"use strict";const r=n(327).fromPromise;const i=n(928);const o=n(312);const{mkdirs:c,mkdirsSync:s}=n(923);const{symlinkPaths:a,symlinkPathsSync:u}=n(599);const{symlinkType:f,symlinkTypeSync:l}=n(563);const{pathExists:y}=n(467);const{areIdentical:p}=n(81);async function createSymlink(t,e,n){let r;try{r=await o.lstat(e)}catch{}if(r&&r.isSymbolicLink()){const[n,r]=await Promise.all([o.stat(t),o.stat(e)]);if(p(n,r))return}const s=await a(t,e);t=s.toDst;const u=await f(s.toCwd,n);const l=i.dirname(e);if(!await y(l)){await c(l)}return o.symlink(t,e,u)}function createSymlinkSync(t,e,n){let r;try{r=o.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const n=o.statSync(t);const r=o.statSync(e);if(p(n,r))return}const c=u(t,e);t=c.toDst;n=l(c.toCwd,n);const a=i.dirname(e);const f=o.existsSync(a);if(f)return o.symlinkSync(t,e,n);s(a);return o.symlinkSync(t,e,n)}t.exports={createSymlink:r(createSymlink),createSymlinkSync:createSymlinkSync}},312:function(t,e,n){"use strict";const r=n(327).fromCallback;const i=n(551);const o=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((t=>typeof i[t]==="function"));Object.assign(e,i);o.forEach((t=>{e[t]=r(i[t])}));e.exists=function(t,e){if(typeof e==="function"){return i.exists(t,e)}return new Promise((e=>i.exists(t,e)))};e.read=function(t,e,n,r,o,c){if(typeof c==="function"){return i.read(t,e,n,r,o,c)}return new Promise(((c,s)=>{i.read(t,e,n,r,o,((t,e,n)=>{if(t)return s(t);c({bytesRead:e,buffer:n})}))}))};e.write=function(t,e,...n){if(typeof n[n.length-1]==="function"){return i.write(t,e,...n)}return new Promise(((r,o)=>{i.write(t,e,...n,((t,e,n)=>{if(t)return o(t);r({bytesWritten:e,buffer:n})}))}))};e.readv=function(t,e,...n){if(typeof n[n.length-1]==="function"){return i.readv(t,e,...n)}return new Promise(((r,o)=>{i.readv(t,e,...n,((t,e,n)=>{if(t)return o(t);r({bytesRead:e,buffers:n})}))}))};e.writev=function(t,e,...n){if(typeof n[n.length-1]==="function"){return i.writev(t,e,...n)}return new Promise(((r,o)=>{i.writev(t,e,...n,((t,e,n)=>{if(t)return o(t);r({bytesWritten:e,buffers:n})}))}))};if(typeof i.realpath.native==="function"){e.realpath.native=r(i.realpath.native)}else{process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}},278:function(t,e,n){"use strict";t.exports={...n(312),...n(394),...n(60),...n(845),...n(333),...n(923),...n(66),...n(175),...n(467),...n(887)}},333:function(t,e,n){"use strict";const r=n(327).fromPromise;const i=n(393);i.outputJson=r(n(919));i.outputJsonSync=n(951);i.outputJSON=i.outputJson;i.outputJSONSync=i.outputJsonSync;i.writeJSON=i.writeJson;i.writeJSONSync=i.writeJsonSync;i.readJSON=i.readJson;i.readJSONSync=i.readJsonSync;t.exports=i},393:function(t,e,n){"use strict";const r=n(535);t.exports={readJson:r.readFile,readJsonSync:r.readFileSync,writeJson:r.writeFile,writeJsonSync:r.writeFileSync}},951:function(t,e,n){"use strict";const{stringify:r}=n(306);const{outputFileSync:i}=n(175);function outputJsonSync(t,e,n){const o=r(e,n);i(t,o,n)}t.exports=outputJsonSync},919:function(t,e,n){"use strict";const{stringify:r}=n(306);const{outputFile:i}=n(175);async function outputJson(t,e,n={}){const o=r(e,n);await i(t,o,n)}t.exports=outputJson},923:function(t,e,n){"use strict";const r=n(327).fromPromise;const{makeDir:i,makeDirSync:o}=n(43);const c=r(i);t.exports={mkdirs:c,mkdirsSync:o,mkdirp:c,mkdirpSync:o,ensureDir:c,ensureDirSync:o}},43:function(t,e,n){"use strict";const r=n(312);const{checkPath:i}=n(806);const getMode=t=>{const e={mode:511};if(typeof t==="number")return t;return{...e,...t}.mode};t.exports.makeDir=async(t,e)=>{i(t);return r.mkdir(t,{mode:getMode(e),recursive:true})};t.exports.makeDirSync=(t,e)=>{i(t);return r.mkdirSync(t,{mode:getMode(e),recursive:true})}},806:function(t,e,n){"use strict";const r=n(928);t.exports.checkPath=function checkPath(t){if(process.platform==="win32"){const e=/[<>:"|?*]/.test(t.replace(r.parse(t).root,""));if(e){const e=new Error(`Path contains invalid characters: ${t}`);e.code="EINVAL";throw e}}}},66:function(t,e,n){"use strict";const r=n(327).fromPromise;t.exports={move:r(n(949)),moveSync:n(245)}},245:function(t,e,n){"use strict";const r=n(551);const i=n(928);const o=n(394).copySync;const c=n(887).removeSync;const s=n(923).mkdirpSync;const a=n(81);function moveSync(t,e,n){n=n||{};const r=n.overwrite||n.clobber||false;const{srcStat:o,isChangingCase:c=false}=a.checkPathsSync(t,e,"move",n);a.checkParentPathsSync(t,o,e,"move");if(!isParentRoot(e))s(i.dirname(e));return doRename(t,e,r,c)}function isParentRoot(t){const e=i.dirname(t);const n=i.parse(e);return n.root===e}function doRename(t,e,n,i){if(i)return rename(t,e,n);if(n){c(e);return rename(t,e,n)}if(r.existsSync(e))throw new Error("dest already exists.");return rename(t,e,n)}function rename(t,e,n){try{r.renameSync(t,e)}catch(r){if(r.code!=="EXDEV")throw r;return moveAcrossDevice(t,e,n)}}function moveAcrossDevice(t,e,n){const r={overwrite:n,errorOnExist:true,preserveTimestamps:true};o(t,e,r);return c(t)}t.exports=moveSync},949:function(t,e,n){"use strict";const r=n(312);const i=n(928);const{copy:o}=n(394);const{remove:c}=n(887);const{mkdirp:s}=n(923);const{pathExists:a}=n(467);const u=n(81);async function move(t,e,n={}){const r=n.overwrite||n.clobber||false;const{srcStat:o,isChangingCase:c=false}=await u.checkPaths(t,e,"move",n);await u.checkParentPaths(t,o,e,"move");const a=i.dirname(e);const f=i.parse(a);if(f.root!==a){await s(a)}return doRename(t,e,r,c)}async function doRename(t,e,n,i){if(!i){if(n){await c(e)}else if(await a(e)){throw new Error("dest already exists.")}}try{await r.rename(t,e)}catch(r){if(r.code!=="EXDEV"){throw r}await moveAcrossDevice(t,e,n)}}async function moveAcrossDevice(t,e,n){const r={overwrite:n,errorOnExist:true,preserveTimestamps:true};await o(t,e,r);return c(t)}t.exports=move},175:function(t,e,n){"use strict";const r=n(327).fromPromise;const i=n(312);const o=n(928);const c=n(923);const s=n(467).pathExists;async function outputFile(t,e,n="utf-8"){const r=o.dirname(t);if(!await s(r)){await c.mkdirs(r)}return i.writeFile(t,e,n)}function outputFileSync(t,...e){const n=o.dirname(t);if(!i.existsSync(n)){c.mkdirsSync(n)}i.writeFileSync(t,...e)}t.exports={outputFile:r(outputFile),outputFileSync:outputFileSync}},467:function(t,e,n){"use strict";const r=n(327).fromPromise;const i=n(312);function pathExists(t){return i.access(t).then((()=>true)).catch((()=>false))}t.exports={pathExists:r(pathExists),pathExistsSync:i.existsSync}},887:function(t,e,n){"use strict";const r=n(551);const i=n(327).fromCallback;function remove(t,e){r.rm(t,{recursive:true,force:true},e)}function removeSync(t){r.rmSync(t,{recursive:true,force:true})}t.exports={remove:i(remove),removeSync:removeSync}},81:function(t,e,n){"use strict";const r=n(312);const i=n(928);const o=n(327).fromPromise;function getStats(t,e,n){const i=n.dereference?t=>r.stat(t,{bigint:true}):t=>r.lstat(t,{bigint:true});return Promise.all([i(t),i(e).catch((t=>{if(t.code==="ENOENT")return null;throw t}))]).then((([t,e])=>({srcStat:t,destStat:e})))}function getStatsSync(t,e,n){let i;const o=n.dereference?t=>r.statSync(t,{bigint:true}):t=>r.lstatSync(t,{bigint:true});const c=o(t);try{i=o(e)}catch(t){if(t.code==="ENOENT")return{srcStat:c,destStat:null};throw t}return{srcStat:c,destStat:i}}async function checkPaths(t,e,n,r){const{srcStat:o,destStat:c}=await getStats(t,e,r);if(c){if(areIdentical(o,c)){const r=i.basename(t);const s=i.basename(e);if(n==="move"&&r!==s&&r.toLowerCase()===s.toLowerCase()){return{srcStat:o,destStat:c,isChangingCase:true}}throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!c.isDirectory()){throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`)}if(!o.isDirectory()&&c.isDirectory()){throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}}if(o.isDirectory()&&isSrcSubdir(t,e)){throw new Error(errMsg(t,e,n))}return{srcStat:o,destStat:c}}function checkPathsSync(t,e,n,r){const{srcStat:o,destStat:c}=getStatsSync(t,e,r);if(c){if(areIdentical(o,c)){const r=i.basename(t);const s=i.basename(e);if(n==="move"&&r!==s&&r.toLowerCase()===s.toLowerCase()){return{srcStat:o,destStat:c,isChangingCase:true}}throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!c.isDirectory()){throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`)}if(!o.isDirectory()&&c.isDirectory()){throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}}if(o.isDirectory()&&isSrcSubdir(t,e)){throw new Error(errMsg(t,e,n))}return{srcStat:o,destStat:c}}async function checkParentPaths(t,e,n,o){const c=i.resolve(i.dirname(t));const s=i.resolve(i.dirname(n));if(s===c||s===i.parse(s).root)return;let a;try{a=await r.stat(s,{bigint:true})}catch(t){if(t.code==="ENOENT")return;throw t}if(areIdentical(e,a)){throw new Error(errMsg(t,n,o))}return checkParentPaths(t,e,s,o)}function checkParentPathsSync(t,e,n,o){const c=i.resolve(i.dirname(t));const s=i.resolve(i.dirname(n));if(s===c||s===i.parse(s).root)return;let a;try{a=r.statSync(s,{bigint:true})}catch(t){if(t.code==="ENOENT")return;throw t}if(areIdentical(e,a)){throw new Error(errMsg(t,n,o))}return checkParentPathsSync(t,e,s,o)}function areIdentical(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function isSrcSubdir(t,e){const n=i.resolve(t).split(i.sep).filter((t=>t));const r=i.resolve(e).split(i.sep).filter((t=>t));return n.every(((t,e)=>r[e]===t))}function errMsg(t,e,n){return`Cannot ${n} '${t}' to a subdirectory of itself, '${e}'.`}t.exports={checkPaths:o(checkPaths),checkPathsSync:checkPathsSync,checkParentPaths:o(checkParentPaths),checkParentPathsSync:checkParentPathsSync,isSrcSubdir:isSrcSubdir,areIdentical:areIdentical}},592:function(t,e,n){"use strict";const r=n(312);const i=n(327).fromPromise;async function utimesMillis(t,e,n){const i=await r.open(t,"r+");let o=null;try{await r.futimes(i,e,n)}finally{try{await r.close(i)}catch(t){o=t}}if(o){throw o}}function utimesMillisSync(t,e,n){const i=r.openSync(t,"r+");r.futimesSync(i,e,n);return r.closeSync(i)}t.exports={utimesMillis:i(utimesMillis),utimesMillisSync:utimesMillisSync}},403:function(t){"use strict";t.exports=clone;var e=Object.getPrototypeOf||function(t){return t.__proto__};function clone(t){if(t===null||typeof t!=="object")return t;if(t instanceof Object)var n={__proto__:e(t)};else var n=Object.create(null);Object.getOwnPropertyNames(t).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}));return n}},551:function(t,e,n){var r=n(896);var i=n(538);var o=n(611);var c=n(403);var s=n(23);var a;var u;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){a=Symbol.for("graceful-fs.queue");u=Symbol.for("graceful-fs.previous")}else{a="___graceful-fs.queue";u="___graceful-fs.previous"}function noop(){}function publishQueue(t,e){Object.defineProperty(t,a,{get:function(){return e}})}var f=noop;if(s.debuglog)f=s.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))f=function(){var t=s.format.apply(s,arguments);t="GFS4: "+t.split(/\n/).join("\nGFS4: ");console.error(t)};if(!r[a]){var l=global[a]||[];publishQueue(r,l);r.close=function(t){function close(e,n){return t.call(r,e,(function(t){if(!t){resetQueue()}if(typeof n==="function")n.apply(this,arguments)}))}Object.defineProperty(close,u,{value:t});return close}(r.close);r.closeSync=function(t){function closeSync(e){t.apply(r,arguments);resetQueue()}Object.defineProperty(closeSync,u,{value:t});return closeSync}(r.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){f(r[a]);n(613).equal(r[a].length,0)}))}}if(!global[a]){publishQueue(global,r[a])}t.exports=patch(c(r));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched){t.exports=patch(r);r.__patched=true}function patch(t){i(t);t.gracefulify=patch;t.createReadStream=createReadStream;t.createWriteStream=createWriteStream;var e=t.readFile;t.readFile=readFile;function readFile(t,n,r){if(typeof n==="function")r=n,n=null;return go$readFile(t,n,r);function go$readFile(t,n,r,i){return e(t,n,(function(e){if(e&&(e.code==="EMFILE"||e.code==="ENFILE"))enqueue([go$readFile,[t,n,r],e,i||Date.now(),Date.now()]);else{if(typeof r==="function")r.apply(this,arguments)}}))}}var n=t.writeFile;t.writeFile=writeFile;function writeFile(t,e,r,i){if(typeof r==="function")i=r,r=null;return go$writeFile(t,e,r,i);function go$writeFile(t,e,r,i,o){return n(t,e,r,(function(n){if(n&&(n.code==="EMFILE"||n.code==="ENFILE"))enqueue([go$writeFile,[t,e,r,i],n,o||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}}))}}var r=t.appendFile;if(r)t.appendFile=appendFile;function appendFile(t,e,n,i){if(typeof n==="function")i=n,n=null;return go$appendFile(t,e,n,i);function go$appendFile(t,e,n,i,o){return r(t,e,n,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$appendFile,[t,e,n,i],r,o||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}}))}}var c=t.copyFile;if(c)t.copyFile=copyFile;function copyFile(t,e,n,r){if(typeof n==="function"){r=n;n=0}return go$copyFile(t,e,n,r);function go$copyFile(t,e,n,r,i){return c(t,e,n,(function(o){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$copyFile,[t,e,n,r],o,i||Date.now(),Date.now()]);else{if(typeof r==="function")r.apply(this,arguments)}}))}}var s=t.readdir;t.readdir=readdir;var a=/^v[0-5]\./;function readdir(t,e,n){if(typeof e==="function")n=e,e=null;var r=a.test(process.version)?function go$readdir(t,e,n,r){return s(t,fs$readdirCallback(t,e,n,r))}:function go$readdir(t,e,n,r){return s(t,e,fs$readdirCallback(t,e,n,r))};return r(t,e,n);function fs$readdirCallback(t,e,n,i){return function(o,c){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([r,[t,e,n],o,i||Date.now(),Date.now()]);else{if(c&&c.sort)c.sort();if(typeof n==="function")n.call(this,o,c)}}}}if(process.version.substr(0,4)==="v0.8"){var u=o(t);ReadStream=u.ReadStream;WriteStream=u.WriteStream}var f=t.ReadStream;if(f){ReadStream.prototype=Object.create(f.prototype);ReadStream.prototype.open=ReadStream$open}var l=t.WriteStream;if(l){WriteStream.prototype=Object.create(l.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(t,"ReadStream",{get:function(){return ReadStream},set:function(t){ReadStream=t},enumerable:true,configurable:true});Object.defineProperty(t,"WriteStream",{get:function(){return WriteStream},set:function(t){WriteStream=t},enumerable:true,configurable:true});var y=ReadStream;Object.defineProperty(t,"FileReadStream",{get:function(){return y},set:function(t){y=t},enumerable:true,configurable:true});var p=WriteStream;Object.defineProperty(t,"FileWriteStream",{get:function(){return p},set:function(t){p=t},enumerable:true,configurable:true});function ReadStream(t,e){if(this instanceof ReadStream)return f.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(e,n){if(e){if(t.autoClose)t.destroy();t.emit("error",e)}else{t.fd=n;t.emit("open",n);t.read()}}))}function WriteStream(t,e){if(this instanceof WriteStream)return l.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(e,n){if(e){t.destroy();t.emit("error",e)}else{t.fd=n;t.emit("open",n)}}))}function createReadStream(e,n){return new t.ReadStream(e,n)}function createWriteStream(e,n){return new t.WriteStream(e,n)}var m=t.open;t.open=open;function open(t,e,n,r){if(typeof n==="function")r=n,n=null;return go$open(t,e,n,r);function go$open(t,e,n,r,i){return m(t,e,n,(function(o,c){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$open,[t,e,n,r],o,i||Date.now(),Date.now()]);else{if(typeof r==="function")r.apply(this,arguments)}}))}}return t}function enqueue(t){f("ENQUEUE",t[0].name,t[1]);r[a].push(t);retry()}var y;function resetQueue(){var t=Date.now();for(var e=0;e<r[a].length;++e){if(r[a][e].length>2){r[a][e][3]=t;r[a][e][4]=t}}retry()}function retry(){clearTimeout(y);y=undefined;if(r[a].length===0)return;var t=r[a].shift();var e=t[0];var n=t[1];var i=t[2];var o=t[3];var c=t[4];if(o===undefined){f("RETRY",e.name,n);e.apply(null,n)}else if(Date.now()-o>=6e4){f("TIMEOUT",e.name,n);var s=n.pop();if(typeof s==="function")s.call(null,i)}else{var u=Date.now()-c;var l=Math.max(c-o,1);var p=Math.min(l*1.2,100);if(u>=p){f("RETRY",e.name,n);e.apply(null,n.concat([o]))}else{r[a].push(t)}}if(y===undefined){y=setTimeout(retry,0)}}},611:function(t,e,n){var r=n(203).Stream;t.exports=legacy;function legacy(t){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(e,n){if(!(this instanceof ReadStream))return new ReadStream(e,n);r.call(this);var i=this;this.path=e;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;n=n||{};var o=Object.keys(n);for(var c=0,s=o.length;c<s;c++){var a=o[c];this[a]=n[a]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){i._read()}));return}t.open(this.path,this.flags,this.mode,(function(t,e){if(t){i.emit("error",t);i.readable=false;return}i.fd=e;i.emit("open",e);i._read()}))}function WriteStream(e,n){if(!(this instanceof WriteStream))return new WriteStream(e,n);r.call(this);this.path=e;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;n=n||{};var i=Object.keys(n);for(var o=0,c=i.length;o<c;o++){var s=i[o];this[s]=n[s]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=t.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},538:function(t,e,n){var r=n(140);var i=process.cwd;var o=null;var c=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!o)o=i.call(process);return o};try{process.cwd()}catch(t){}if(typeof process.chdir==="function"){var s=process.chdir;process.chdir=function(t){o=null;s.call(process,t)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,s)}t.exports=patch;function patch(t){if(r.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(t)}if(!t.lutimes){patchLutimes(t)}t.chown=chownFix(t.chown);t.fchown=chownFix(t.fchown);t.lchown=chownFix(t.lchown);t.chmod=chmodFix(t.chmod);t.fchmod=chmodFix(t.fchmod);t.lchmod=chmodFix(t.lchmod);t.chownSync=chownFixSync(t.chownSync);t.fchownSync=chownFixSync(t.fchownSync);t.lchownSync=chownFixSync(t.lchownSync);t.chmodSync=chmodFixSync(t.chmodSync);t.fchmodSync=chmodFixSync(t.fchmodSync);t.lchmodSync=chmodFixSync(t.lchmodSync);t.stat=statFix(t.stat);t.fstat=statFix(t.fstat);t.lstat=statFix(t.lstat);t.statSync=statFixSync(t.statSync);t.fstatSync=statFixSync(t.fstatSync);t.lstatSync=statFixSync(t.lstatSync);if(t.chmod&&!t.lchmod){t.lchmod=function(t,e,n){if(n)process.nextTick(n)};t.lchmodSync=function(){}}if(t.chown&&!t.lchown){t.lchown=function(t,e,n,r){if(r)process.nextTick(r)};t.lchownSync=function(){}}if(c==="win32"){t.rename=typeof t.rename!=="function"?t.rename:function(e){function rename(n,r,i){var o=Date.now();var c=0;e(n,r,(function CB(s){if(s&&(s.code==="EACCES"||s.code==="EPERM"||s.code==="EBUSY")&&Date.now()-o<6e4){setTimeout((function(){t.stat(r,(function(t,o){if(t&&t.code==="ENOENT")e(n,r,CB);else i(s)}))}),c);if(c<100)c+=10;return}if(i)i(s)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,e);return rename}(t.rename)}t.read=typeof t.read!=="function"?t.read:function(e){function read(n,r,i,o,c,s){var a;if(s&&typeof s==="function"){var u=0;a=function(f,l,y){if(f&&f.code==="EAGAIN"&&u<10){u++;return e.call(t,n,r,i,o,c,a)}s.apply(this,arguments)}}return e.call(t,n,r,i,o,c,a)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,e);return read}(t.read);t.readSync=typeof t.readSync!=="function"?t.readSync:function(e){return function(n,r,i,o,c){var s=0;while(true){try{return e.call(t,n,r,i,o,c)}catch(t){if(t.code==="EAGAIN"&&s<10){s++;continue}throw t}}}}(t.readSync);function patchLchmod(t){t.lchmod=function(e,n,i){t.open(e,r.O_WRONLY|r.O_SYMLINK,n,(function(e,r){if(e){if(i)i(e);return}t.fchmod(r,n,(function(e){t.close(r,(function(t){if(i)i(e||t)}))}))}))};t.lchmodSync=function(e,n){var i=t.openSync(e,r.O_WRONLY|r.O_SYMLINK,n);var o=true;var c;try{c=t.fchmodSync(i,n);o=false}finally{if(o){try{t.closeSync(i)}catch(t){}}else{t.closeSync(i)}}return c}}function patchLutimes(t){if(r.hasOwnProperty("O_SYMLINK")&&t.futimes){t.lutimes=function(e,n,i,o){t.open(e,r.O_SYMLINK,(function(e,r){if(e){if(o)o(e);return}t.futimes(r,n,i,(function(e){t.close(r,(function(t){if(o)o(e||t)}))}))}))};t.lutimesSync=function(e,n,i){var o=t.openSync(e,r.O_SYMLINK);var c;var s=true;try{c=t.futimesSync(o,n,i);s=false}finally{if(s){try{t.closeSync(o)}catch(t){}}else{t.closeSync(o)}}return c}}else if(t.futimes){t.lutimes=function(t,e,n,r){if(r)process.nextTick(r)};t.lutimesSync=function(){}}}function chmodFix(e){if(!e)return e;return function(n,r,i){return e.call(t,n,r,(function(t){if(chownErOk(t))t=null;if(i)i.apply(this,arguments)}))}}function chmodFixSync(e){if(!e)return e;return function(n,r){try{return e.call(t,n,r)}catch(t){if(!chownErOk(t))throw t}}}function chownFix(e){if(!e)return e;return function(n,r,i,o){return e.call(t,n,r,i,(function(t){if(chownErOk(t))t=null;if(o)o.apply(this,arguments)}))}}function chownFixSync(e){if(!e)return e;return function(n,r,i){try{return e.call(t,n,r,i)}catch(t){if(!chownErOk(t))throw t}}}function statFix(e){if(!e)return e;return function(n,r,i){if(typeof r==="function"){i=r;r=null}function callback(t,e){if(e){if(e.uid<0)e.uid+=4294967296;if(e.gid<0)e.gid+=4294967296}if(i)i.apply(this,arguments)}return r?e.call(t,n,r,callback):e.call(t,n,callback)}}function statFixSync(e){if(!e)return e;return function(n,r){var i=r?e.call(t,n,r):e.call(t,n);if(i){if(i.uid<0)i.uid+=4294967296;if(i.gid<0)i.gid+=4294967296}return i}}function chownErOk(t){if(!t)return true;if(t.code==="ENOSYS")return true;var e=!process.getuid||process.getuid()!==0;if(e){if(t.code==="EINVAL"||t.code==="EPERM")return true}return false}}},535:function(t,e,n){let r;try{r=n(551)}catch(t){r=n(896)}const i=n(327);const{stringify:o,stripBom:c}=n(306);async function _readFile(t,e={}){if(typeof e==="string"){e={encoding:e}}const n=e.fs||r;const o="throws"in e?e.throws:true;let s=await i.fromCallback(n.readFile)(t,e);s=c(s);let a;try{a=JSON.parse(s,e?e.reviver:null)}catch(e){if(o){e.message=`${t}: ${e.message}`;throw e}else{return null}}return a}const s=i.fromPromise(_readFile);function readFileSync(t,e={}){if(typeof e==="string"){e={encoding:e}}const n=e.fs||r;const i="throws"in e?e.throws:true;try{let r=n.readFileSync(t,e);r=c(r);return JSON.parse(r,e.reviver)}catch(e){if(i){e.message=`${t}: ${e.message}`;throw e}else{return null}}}async function _writeFile(t,e,n={}){const c=n.fs||r;const s=o(e,n);await i.fromCallback(c.writeFile)(t,s,n)}const a=i.fromPromise(_writeFile);function writeFileSync(t,e,n={}){const i=n.fs||r;const c=o(e,n);return i.writeFileSync(t,c,n)}const u={readFile:s,readFileSync:readFileSync,writeFile:a,writeFileSync:writeFileSync};t.exports=u},306:function(t){function stringify(t,{EOL:e="\n",finalEOL:n=true,replacer:r=null,spaces:i}={}){const o=n?e:"";const c=JSON.stringify(t,r,i);return c.replace(/\n/g,e)+o}function stripBom(t){if(Buffer.isBuffer(t))t=t.toString("utf8");return t.replace(/^\uFEFF/,"")}t.exports={stringify:stringify,stripBom:stripBom}},327:function(t,e){"use strict";e.fromCallback=function(t){return Object.defineProperty((function(...e){if(typeof e[e.length-1]==="function")t.apply(this,e);else{return new Promise(((n,r)=>{e.push(((t,e)=>t!=null?r(t):n(e)));t.apply(this,e)}))}}),"name",{value:t.name})};e.fromPromise=function(t){return Object.defineProperty((function(...e){const n=e[e.length-1];if(typeof n!=="function")return t.apply(this,e);else{e.pop();t.apply(this,e).then((t=>n(null,t)),n)}}),"name",{value:t.name})}},613:function(t){"use strict";t.exports=require("assert")},140:function(t){"use strict";t.exports=require("constants")},896:function(t){"use strict";t.exports=require("fs")},928:function(t){"use strict";t.exports=require("path")},203:function(t){"use strict";t.exports=require("stream")},23:function(t){"use strict";t.exports=require("util")}};var e={};function __nccwpck_require__(n){var r=e[n];if(r!==undefined){return r.exports}var i=e[n]={exports:{}};var o=true;try{t[n](i,i.exports,__nccwpck_require__);o=false}finally{if(o)delete e[n]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n=__nccwpck_require__(278);module.exports=n})();
@@ -0,0 +1,16 @@
1
+ 'use strict'
2
+
3
+ const u = require('universalify').fromPromise
4
+ const jsonFile = require('./jsonfile')
5
+
6
+ jsonFile.outputJson = u(require('./output-json'))
7
+ jsonFile.outputJsonSync = require('./output-json-sync')
8
+ // aliases
9
+ jsonFile.outputJSON = jsonFile.outputJson
10
+ jsonFile.outputJSONSync = jsonFile.outputJsonSync
11
+ jsonFile.writeJSON = jsonFile.writeJson
12
+ jsonFile.writeJSONSync = jsonFile.writeJsonSync
13
+ jsonFile.readJSON = jsonFile.readJson
14
+ jsonFile.readJSONSync = jsonFile.readJsonSync
15
+
16
+ module.exports = jsonFile
@@ -0,0 +1,11 @@
1
+ 'use strict'
2
+
3
+ const jsonFile = require('jsonfile')
4
+
5
+ module.exports = {
6
+ // jsonfile exports
7
+ readJson: jsonFile.readFile,
8
+ readJsonSync: jsonFile.readFileSync,
9
+ writeJson: jsonFile.writeFile,
10
+ writeJsonSync: jsonFile.writeFileSync
11
+ }
@@ -0,0 +1,12 @@
1
+ 'use strict'
2
+
3
+ const { stringify } = require('jsonfile/utils')
4
+ const { outputFileSync } = require('../output-file')
5
+
6
+ function outputJsonSync (file, data, options) {
7
+ const str = stringify(data, options)
8
+
9
+ outputFileSync(file, str, options)
10
+ }
11
+
12
+ module.exports = outputJsonSync
@@ -0,0 +1,12 @@
1
+ 'use strict'
2
+
3
+ const { stringify } = require('jsonfile/utils')
4
+ const { outputFile } = require('../output-file')
5
+
6
+ async function outputJson (file, data, options = {}) {
7
+ const str = stringify(data, options)
8
+
9
+ await outputFile(file, str, options)
10
+ }
11
+
12
+ module.exports = outputJson
@@ -0,0 +1,14 @@
1
+ 'use strict'
2
+ const u = require('universalify').fromPromise
3
+ const { makeDir: _makeDir, makeDirSync } = require('./make-dir')
4
+ const makeDir = u(_makeDir)
5
+
6
+ module.exports = {
7
+ mkdirs: makeDir,
8
+ mkdirsSync: makeDirSync,
9
+ // alias
10
+ mkdirp: makeDir,
11
+ mkdirpSync: makeDirSync,
12
+ ensureDir: makeDir,
13
+ ensureDirSync: makeDirSync
14
+ }
@@ -0,0 +1,27 @@
1
+ 'use strict'
2
+ const fs = require('../fs')
3
+ const { checkPath } = require('./utils')
4
+
5
+ const getMode = options => {
6
+ const defaults = { mode: 0o777 }
7
+ if (typeof options === 'number') return options
8
+ return ({ ...defaults, ...options }).mode
9
+ }
10
+
11
+ module.exports.makeDir = async (dir, options) => {
12
+ checkPath(dir)
13
+
14
+ return fs.mkdir(dir, {
15
+ mode: getMode(options),
16
+ recursive: true
17
+ })
18
+ }
19
+
20
+ module.exports.makeDirSync = (dir, options) => {
21
+ checkPath(dir)
22
+
23
+ return fs.mkdirSync(dir, {
24
+ mode: getMode(options),
25
+ recursive: true
26
+ })
27
+ }
@@ -0,0 +1,21 @@
1
+ // Adapted from https://github.com/sindresorhus/make-dir
2
+ // Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
3
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+ // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6
+ 'use strict'
7
+ const path = require('path')
8
+
9
+ // https://github.com/nodejs/node/issues/8987
10
+ // https://github.com/libuv/libuv/pull/1088
11
+ module.exports.checkPath = function checkPath (pth) {
12
+ if (process.platform === 'win32') {
13
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''))
14
+
15
+ if (pathHasInvalidWinCharacters) {
16
+ const error = new Error(`Path contains invalid characters: ${pth}`)
17
+ error.code = 'EINVAL'
18
+ throw error
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,7 @@
1
+ 'use strict'
2
+
3
+ const u = require('universalify').fromPromise
4
+ module.exports = {
5
+ move: u(require('./move')),
6
+ moveSync: require('./move-sync')
7
+ }
@@ -0,0 +1,55 @@
1
+ 'use strict'
2
+
3
+ const fs = require('graceful-fs')
4
+ const path = require('path')
5
+ const copySync = require('../copy').copySync
6
+ const removeSync = require('../remove').removeSync
7
+ const mkdirpSync = require('../mkdirs').mkdirpSync
8
+ const stat = require('../util/stat')
9
+
10
+ function moveSync (src, dest, opts) {
11
+ opts = opts || {}
12
+ const overwrite = opts.overwrite || opts.clobber || false
13
+
14
+ const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts)
15
+ stat.checkParentPathsSync(src, srcStat, dest, 'move')
16
+ if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest))
17
+ return doRename(src, dest, overwrite, isChangingCase)
18
+ }
19
+
20
+ function isParentRoot (dest) {
21
+ const parent = path.dirname(dest)
22
+ const parsedPath = path.parse(parent)
23
+ return parsedPath.root === parent
24
+ }
25
+
26
+ function doRename (src, dest, overwrite, isChangingCase) {
27
+ if (isChangingCase) return rename(src, dest, overwrite)
28
+ if (overwrite) {
29
+ removeSync(dest)
30
+ return rename(src, dest, overwrite)
31
+ }
32
+ if (fs.existsSync(dest)) throw new Error('dest already exists.')
33
+ return rename(src, dest, overwrite)
34
+ }
35
+
36
+ function rename (src, dest, overwrite) {
37
+ try {
38
+ fs.renameSync(src, dest)
39
+ } catch (err) {
40
+ if (err.code !== 'EXDEV') throw err
41
+ return moveAcrossDevice(src, dest, overwrite)
42
+ }
43
+ }
44
+
45
+ function moveAcrossDevice (src, dest, overwrite) {
46
+ const opts = {
47
+ overwrite,
48
+ errorOnExist: true,
49
+ preserveTimestamps: true
50
+ }
51
+ copySync(src, dest, opts)
52
+ return removeSync(src)
53
+ }
54
+
55
+ module.exports = moveSync
@@ -0,0 +1,59 @@
1
+ 'use strict'
2
+
3
+ const fs = require('../fs')
4
+ const path = require('path')
5
+ const { copy } = require('../copy')
6
+ const { remove } = require('../remove')
7
+ const { mkdirp } = require('../mkdirs')
8
+ const { pathExists } = require('../path-exists')
9
+ const stat = require('../util/stat')
10
+
11
+ async function move (src, dest, opts = {}) {
12
+ const overwrite = opts.overwrite || opts.clobber || false
13
+
14
+ const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, 'move', opts)
15
+
16
+ await stat.checkParentPaths(src, srcStat, dest, 'move')
17
+
18
+ // If the parent of dest is not root, make sure it exists before proceeding
19
+ const destParent = path.dirname(dest)
20
+ const parsedParentPath = path.parse(destParent)
21
+ if (parsedParentPath.root !== destParent) {
22
+ await mkdirp(destParent)
23
+ }
24
+
25
+ return doRename(src, dest, overwrite, isChangingCase)
26
+ }
27
+
28
+ async function doRename (src, dest, overwrite, isChangingCase) {
29
+ if (!isChangingCase) {
30
+ if (overwrite) {
31
+ await remove(dest)
32
+ } else if (await pathExists(dest)) {
33
+ throw new Error('dest already exists.')
34
+ }
35
+ }
36
+
37
+ try {
38
+ // Try w/ rename first, and try copy + remove if EXDEV
39
+ await fs.rename(src, dest)
40
+ } catch (err) {
41
+ if (err.code !== 'EXDEV') {
42
+ throw err
43
+ }
44
+ await moveAcrossDevice(src, dest, overwrite)
45
+ }
46
+ }
47
+
48
+ async function moveAcrossDevice (src, dest, overwrite) {
49
+ const opts = {
50
+ overwrite,
51
+ errorOnExist: true,
52
+ preserveTimestamps: true
53
+ }
54
+
55
+ await copy(src, dest, opts)
56
+ return remove(src)
57
+ }
58
+
59
+ module.exports = move
@@ -0,0 +1,31 @@
1
+ 'use strict'
2
+
3
+ const u = require('universalify').fromPromise
4
+ const fs = require('../fs')
5
+ const path = require('path')
6
+ const mkdir = require('../mkdirs')
7
+ const pathExists = require('../path-exists').pathExists
8
+
9
+ async function outputFile (file, data, encoding = 'utf-8') {
10
+ const dir = path.dirname(file)
11
+
12
+ if (!(await pathExists(dir))) {
13
+ await mkdir.mkdirs(dir)
14
+ }
15
+
16
+ return fs.writeFile(file, data, encoding)
17
+ }
18
+
19
+ function outputFileSync (file, ...args) {
20
+ const dir = path.dirname(file)
21
+ if (!fs.existsSync(dir)) {
22
+ mkdir.mkdirsSync(dir)
23
+ }
24
+
25
+ fs.writeFileSync(file, ...args)
26
+ }
27
+
28
+ module.exports = {
29
+ outputFile: u(outputFile),
30
+ outputFileSync
31
+ }
@@ -0,0 +1,12 @@
1
+ 'use strict'
2
+ const u = require('universalify').fromPromise
3
+ const fs = require('../fs')
4
+
5
+ function pathExists (path) {
6
+ return fs.access(path).then(() => true).catch(() => false)
7
+ }
8
+
9
+ module.exports = {
10
+ pathExists: u(pathExists),
11
+ pathExistsSync: fs.existsSync
12
+ }
@@ -0,0 +1,17 @@
1
+ 'use strict'
2
+
3
+ const fs = require('graceful-fs')
4
+ const u = require('universalify').fromCallback
5
+
6
+ function remove (path, callback) {
7
+ fs.rm(path, { recursive: true, force: true }, callback)
8
+ }
9
+
10
+ function removeSync (path) {
11
+ fs.rmSync(path, { recursive: true, force: true })
12
+ }
13
+
14
+ module.exports = {
15
+ remove: u(remove),
16
+ removeSync
17
+ }