@stacksjs/storage 0.47.4 → 0.49.0

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/dist/index.d.ts CHANGED
@@ -37,6 +37,7 @@ export declare function deleteFolder(path: string): Promise<void>;
37
37
  export declare function deleteFiles(dir: string, exclude?: string[]): void;
38
38
  export declare function deleteEmptyFolders(dir: string): void;
39
39
  export declare function doesFolderExist(path: string): any;
40
+ export declare function createFolder(dir: string): Promise<void>;
40
41
  export declare const filesystem: {
41
42
  _dirname: any;
42
43
  readJsonFile: typeof readJsonFile;
package/dist/index.mjs CHANGED
@@ -117,6 +117,16 @@ export function deleteEmptyFolders(dir) {
117
117
  export function doesFolderExist(path) {
118
118
  return fs.existsSync(path);
119
119
  }
120
+ export function createFolder(dir) {
121
+ return new Promise((resolve, reject) => {
122
+ fs.mkdirs(dir, (err) => {
123
+ if (err)
124
+ reject(err);
125
+ else
126
+ resolve();
127
+ });
128
+ });
129
+ }
120
130
  export const filesystem = {
121
131
  _dirname,
122
132
  readJsonFile,
@@ -134,6 +144,8 @@ export const filesystem = {
134
144
  deleteEmptyFolders,
135
145
  doesFolderExist,
136
146
  fs,
147
+ // potentially refactor to `...fs` but, currently, there is an issues when building @stacksjs/config
148
+ // the problem is relating to https://github.com/microsoft/TypeScript/issues/5711#issuecomment-157793294
137
149
  fileURLToPath
138
150
  };
139
151
  export default filesystem;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/storage",
3
3
  "type": "module",
4
- "version": "0.47.4",
5
- "packageManager": "pnpm@7.21.0",
4
+ "version": "0.49.0",
5
+ "packageManager": "pnpm@7.25.0",
6
6
  "description": "The Stacks file system.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -37,21 +37,21 @@
37
37
  "README.md"
38
38
  ],
39
39
  "engines": {
40
- "node": ">=v18.12.1",
41
- "pnpm": ">=7.21.0"
40
+ "node": ">=v18.13.0",
41
+ "pnpm": ">=7.25.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "fs-extra": "^11.1.0",
45
45
  "unstorage": "^1.0.1",
46
- "@stacksjs/arrays": "0.47.4",
47
- "@stacksjs/types": "0.47.4",
48
- "@stacksjs/utils": "0.47.4"
46
+ "@stacksjs/arrays": "0.49.0",
47
+ "@stacksjs/types": "0.49.0",
48
+ "@stacksjs/utils": "0.49.0"
49
49
  },
50
50
  "devDependencies": {
51
- "mkdist": "^1.0.0",
51
+ "mkdist": "^1.1.0",
52
52
  "typescript": "^4.9.4",
53
- "@stacksjs/path": "0.47.4",
54
- "@stacksjs/testing": "0.47.4"
53
+ "@stacksjs/path": "0.49.0",
54
+ "@stacksjs/testing": "0.49.0"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "mkdist -d",