expo-file-system 18.0.8 → 18.0.10
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 +9 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/filesystem/next/FileSystemPath.kt +1 -1
- package/build/next/ExpoFileSystem.types.d.ts +4 -4
- package/build/next/ExpoFileSystem.types.d.ts.map +1 -1
- package/build/next/streams.d.ts +2 -2
- package/build/next/streams.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/next/ExpoFileSystem.types.ts +4 -4
- package/src/next/FileSystem.ts +1 -1
- package/src/next/pathUtilities/path.ts +2 -2
- package/src/next/pathUtilities/url.ts +2 -2
- package/src/next/streams.ts +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -10,10 +10,19 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 18.0.10 — 2025-02-06
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 18.0.9 — 2025-02-03
|
|
18
|
+
|
|
19
|
+
_This version does not introduce any user-facing changes._
|
|
20
|
+
|
|
13
21
|
## 18.0.8 — 2025-01-31
|
|
14
22
|
|
|
15
23
|
### 🐛 Bug fixes
|
|
16
24
|
|
|
25
|
+
- Fix types that are erroring in default template. ([#34520](https://github.com/expo/expo/pull/34520) by [@aleqsio](https://github.com/aleqsio))
|
|
17
26
|
- [Android] fixed issue with deleting a directory with children ([#34550](https://github.com/expo/expo/pull/34550) by [@chrfalch](https://github.com/chrfalch))
|
|
18
27
|
|
|
19
28
|
## 18.0.7 — 2025-01-10
|
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
|
|
3
3
|
group = 'host.exp.exponent'
|
|
4
|
-
version = '18.0.
|
|
4
|
+
version = '18.0.10'
|
|
5
5
|
|
|
6
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
7
7
|
apply from: expoModulesCorePlugin
|
|
@@ -14,7 +14,7 @@ android {
|
|
|
14
14
|
namespace "expo.modules.filesystem"
|
|
15
15
|
defaultConfig {
|
|
16
16
|
versionCode 30
|
|
17
|
-
versionName "18.0.
|
|
17
|
+
versionName "18.0.10"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ abstract class FileSystemPath(public var file: File) : SharedObject() {
|
|
|
22
22
|
// Recursively delete subdirectories
|
|
23
23
|
delete(child)
|
|
24
24
|
} else {
|
|
25
|
-
if(!child.delete()) {
|
|
25
|
+
if (!child.delete()) {
|
|
26
26
|
throw UnableToDeleteException("failed to delete '${child.path}'")
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -37,11 +37,11 @@ export declare class Directory {
|
|
|
37
37
|
/**
|
|
38
38
|
* Copies a directory.
|
|
39
39
|
*/
|
|
40
|
-
copy(destination: Directory | File):
|
|
40
|
+
copy(destination: Directory | File): void;
|
|
41
41
|
/**
|
|
42
42
|
* Moves a directory. Updates the `uri` property that now points to the new location.
|
|
43
43
|
*/
|
|
44
|
-
move(destination: Directory | File):
|
|
44
|
+
move(destination: Directory | File): void;
|
|
45
45
|
/**
|
|
46
46
|
* @hidden
|
|
47
47
|
* Lists the contents of a directory. Should not be used directly, as it returns a list of paths.
|
|
@@ -115,11 +115,11 @@ export declare class File {
|
|
|
115
115
|
/**
|
|
116
116
|
* Copies a file.
|
|
117
117
|
*/
|
|
118
|
-
copy(destination: Directory | File):
|
|
118
|
+
copy(destination: Directory | File): void;
|
|
119
119
|
/**
|
|
120
120
|
* Moves a directory. Updates the `uri` property that now points to the new location.
|
|
121
121
|
*/
|
|
122
|
-
move(destination: Directory | File):
|
|
122
|
+
move(destination: Directory | File): void;
|
|
123
123
|
/**
|
|
124
124
|
* Returns a FileHandle object that can be used to read and write data to the file.
|
|
125
125
|
* @throws Error if the file does not exist or cannot be opened.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoFileSystem.types.d.ts","sourceRoot":"","sources":["../../src/next/ExpoFileSystem.types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B;;;;;;;OAOG;gBACS,GAAG,IAAI,EAAE,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE;IAElD;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,YAAY,IAAI,IAAI;IAEpB;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAEd;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAEd;;OAEG;IACH,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"ExpoFileSystem.types.d.ts","sourceRoot":"","sources":["../../src/next/ExpoFileSystem.types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B;;;;;;;OAOG;gBACS,GAAG,IAAI,EAAE,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE;IAElD;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,YAAY,IAAI,IAAI;IAEpB;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAEd;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAEd;;OAEG;IACH,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI;IAEzC;;OAEG;IACH,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI;IAEzC;;;;OAIG;IACH,aAAa,IAAI;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,IAAI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GAAG,UAAU;IAKrC,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAMnC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAItB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB"}
|
package/build/next/streams.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ export declare class FileSystemReadableStreamSource implements UnderlyingByteSou
|
|
|
3
3
|
handle: FileHandle;
|
|
4
4
|
size: number;
|
|
5
5
|
type: "bytes";
|
|
6
|
-
constructor(handle:
|
|
6
|
+
constructor(handle: FileHandle);
|
|
7
7
|
cancel(): void;
|
|
8
8
|
pull(controller: ReadableByteStreamController): void;
|
|
9
9
|
}
|
|
10
10
|
export declare class FileSystemWritableSink implements UnderlyingSink {
|
|
11
11
|
handle: FileHandle;
|
|
12
|
-
constructor(handle:
|
|
12
|
+
constructor(handle: FileHandle);
|
|
13
13
|
abort(): void;
|
|
14
14
|
close(): void;
|
|
15
15
|
write(chunk: Uint8Array): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../../src/next/streams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qBAAa,8BAA+B,YAAW,oBAAoB;IACzE,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAQ;IACpB,IAAI,UAAoB;gBAEZ,MAAM,
|
|
1
|
+
{"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../../src/next/streams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qBAAa,8BAA+B,YAAW,oBAAoB;IACzE,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAQ;IACpB,IAAI,UAAoB;gBAEZ,MAAM,EAAE,UAAU;IAI9B,MAAM;IAIN,IAAI,CAAC,UAAU,EAAE,4BAA4B;CA6B9C;AAED,qBAAa,sBAAuB,YAAW,cAAc;IAC3D,MAAM,EAAE,UAAU,CAAC;gBAEP,MAAM,EAAE,UAAU;IAI9B,KAAK;IAIL,KAAK;IAIL,KAAK,CAAC,KAAK,EAAE,UAAU;CAGxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-file-system",
|
|
3
|
-
"version": "18.0.
|
|
3
|
+
"version": "18.0.10",
|
|
4
4
|
"description": "Provides access to the local file system on the device.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"web-streams-polyfill": "^3.3.2"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "9442f00874e0cd738030abae80e5bdef184a2581"
|
|
49
49
|
}
|
|
@@ -43,12 +43,12 @@ export declare class Directory {
|
|
|
43
43
|
/**
|
|
44
44
|
* Copies a directory.
|
|
45
45
|
*/
|
|
46
|
-
copy(destination: Directory | File);
|
|
46
|
+
copy(destination: Directory | File): void;
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Moves a directory. Updates the `uri` property that now points to the new location.
|
|
50
50
|
*/
|
|
51
|
-
move(destination: Directory | File);
|
|
51
|
+
move(destination: Directory | File): void;
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* @hidden
|
|
@@ -132,12 +132,12 @@ export declare class File {
|
|
|
132
132
|
/**
|
|
133
133
|
* Copies a file.
|
|
134
134
|
*/
|
|
135
|
-
copy(destination: Directory | File);
|
|
135
|
+
copy(destination: Directory | File): void;
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
138
|
* Moves a directory. Updates the `uri` property that now points to the new location.
|
|
139
139
|
*/
|
|
140
|
-
move(destination: Directory | File);
|
|
140
|
+
move(destination: Directory | File): void;
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
143
|
* Returns a FileHandle object that can be used to read and write data to the file.
|
package/src/next/FileSystem.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
20
20
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
21
21
|
|
|
22
|
-
function isPathSeparator(code) {
|
|
22
|
+
function isPathSeparator(code: string) {
|
|
23
23
|
return code === '/';
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -85,7 +85,7 @@ function normalizeString(path: string, allowAboveRoot: boolean, separator: strin
|
|
|
85
85
|
return res;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
function formatExt(ext) {
|
|
88
|
+
function formatExt(ext?: string) {
|
|
89
89
|
return ext ? `${ext[0] === '.' ? '' : '.'}${ext}` : '';
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -61,7 +61,7 @@ export function pathToFileURL(filepath: string) {
|
|
|
61
61
|
return new URL(pathToFileURLString(filepath));
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
function getPathFromURLPosix(url) {
|
|
64
|
+
function getPathFromURLPosix(url: { hostname: string; pathname: string }) {
|
|
65
65
|
if (url.hostname !== '') {
|
|
66
66
|
throw new Error(
|
|
67
67
|
'URL host must be localhost or empty – are you sure your url starts with `file:///`?'
|
|
@@ -70,7 +70,7 @@ function getPathFromURLPosix(url) {
|
|
|
70
70
|
const pathname = url.pathname;
|
|
71
71
|
for (let n = 0; n < pathname.length; n++) {
|
|
72
72
|
if (pathname[n] === '%') {
|
|
73
|
-
const third = pathname.charAt(
|
|
73
|
+
const third = +pathname.charAt(n + 2) | 0x20;
|
|
74
74
|
if (pathname[n + 1] === '2' && third === 102) {
|
|
75
75
|
throw new Error('pathname must not include encoded / characters');
|
|
76
76
|
}
|
package/src/next/streams.ts
CHANGED
|
@@ -5,7 +5,7 @@ export class FileSystemReadableStreamSource implements UnderlyingByteSource {
|
|
|
5
5
|
size: number = 1024;
|
|
6
6
|
type = 'bytes' as const;
|
|
7
7
|
|
|
8
|
-
constructor(handle) {
|
|
8
|
+
constructor(handle: FileHandle) {
|
|
9
9
|
this.handle = handle;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -35,8 +35,9 @@ export class FileSystemReadableStreamSource implements UnderlyingByteSource {
|
|
|
35
35
|
if (theView instanceof Uint8Array) {
|
|
36
36
|
theView.set(bytes, theView.byteOffset);
|
|
37
37
|
} else {
|
|
38
|
+
const array = new Uint8Array(theView.buffer);
|
|
38
39
|
for (let i = 0; i < bytes.length; i++) {
|
|
39
|
-
|
|
40
|
+
array[i + theView.byteOffset] = bytes[i];
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
controller.byobRequest.respond(bytes.length);
|
|
@@ -46,7 +47,7 @@ export class FileSystemReadableStreamSource implements UnderlyingByteSource {
|
|
|
46
47
|
export class FileSystemWritableSink implements UnderlyingSink {
|
|
47
48
|
handle: FileHandle;
|
|
48
49
|
|
|
49
|
-
constructor(handle) {
|
|
50
|
+
constructor(handle: FileHandle) {
|
|
50
51
|
this.handle = handle;
|
|
51
52
|
}
|
|
52
53
|
|