Commit Graph

107 Commits

Author SHA1 Message Date
Kenta Moriuchi
4d4bd0eb92
refactor(archive,async,cli,csv,dotenv,encoding,expect,fmt,front-matter,fs,http,internal,log,net,path,semver,testing,text,webgpu,yaml): enable "exactOptionalPropertyTypes" option (#5892) 2024-09-04 14:15:01 +09:00
Doctor
9298ea503f
feat(archive): UntarStream and TarStream (#4548)
* refactor(archive): An implementation of Tar as streams

* fmt(archive): Ran `deno fmt`

* fix(archive): fixed JSDoc examples in tar_streams.ts

* fix(archive): fixed JSDoc examples so `deno task test` doesn't complain

* fix(archive): lint license error

* fix(archive): lint error files not exported

* set(archive): Set current time as mtime for default

* resolve(archive): resolves comments made

* add(archive): `{ mode: 'byob' }` support for TarStream

* add(archive): `{ mode: 'byob' }` support for UnTarStream

* adjust(archive): The logical flow of a few if statements

* tests(archive): Updated Tests for Un/TarStream

* fix(archive): TarStream mtime wasn't an octal

* fix(archive): TarStream tests

* add(archive): Added parsePathname function

Added parsePathname function abstracting the logic out of TarStream allowing the developer to validate pathnames before providing them to TarStream hoping it doesn't throw an error and require the archive creation to start all over again.

* fix(archive): extra bytes incorrectly appending at the end of files

When the appending file was exactly divisible by 512 bytes, an extra 512 bytes was being appending instead of zero to fill in the gap, causing the next header to be read at the wrong place.

* adjust(archive): to always return the amount of bytes requested

Instead of using enqueue, the leftover bytes are saved for later for the next buffer provided.

* tweaks

* fix

* docs(archive): Link to the spec that they're following

* docs(archive): fix spelling

* add(archive): function validTarSteamOptions

- To make sure, if TarStreamOptions are being provided, that they are in the correct format so as to not create bad tarballs.

* add(archive): more tests

* fix(archive): validTarStreamOptions

* add(archive): tests for validTarStreamOptions

* refactor(archive): code to copy the changes made in the @doctor/tar-stream version

* test(archive): added from @doctor/tar-stream

* chore: nit on anonymous function

* refactor(archive): UnTarStream that fixes unexplainable memory leak

- The second newest test introduced here '... with invalid ending' seems to detect a memory leak due to an invalid tarball. I couldn't figure out why the memory leak was happening but I know this restructure of the code doesn't have that same memory leak.

* chore: fmt

* tests(archive): added remaining tests to cover many lines as possible

* adjust(archive): remove simplify pathname code

* adjust(archive): remove checking for duplicate pathnames in taring process

* adjust(archive): A readable will exist on TarEntry unless string values 1-6

* tests(archive): added more tests for higher coverage

* adjust(archives): TarStream and UnTarStream to implement TransformStream

* docs(archive): moved TarStreamOptions docs into properties.

* adjust(archive): TarStreamFile to take a ReadableSteam instead of an Iterable | AsyncIterable

* adjust(archive): to use FixedChunkStream instead of rolling it's own implementation

* fix(archive): lint error

* adjust(archive): Error types and messages

* adjust(archive): more Error messages / improve tests

* refactor(archive): UnTarStream to return TarStreamChunk instead of TarStreamEntry

* fix(archive): JSDoc example

* adjust(archive): mode, uid, gid options to be provided as numbers instead of strings.

* adjust(archive): TarStream's pathname to be only of type string

* fix(archive): prefix/name to ignore everything past the first NULL

* adjust(archive): `checksum` and `pad` to not be exposed from UnTarStream

* adjust(archive): checksum calculation

* change(archive): `.slice` to `.subarray`

* doc(archive): "octal number" to "octal literal"

* adjust(archive): TarStreamOptions to be optional with defaults

* doc(archive): added more docs for the interfaces

* docs(archive): denoting defaults

* docs(archive): updated for new lint rules

* adjust(archive): Tests to use assertRejects where appropriate & add `validPathname` function

- The `validPathname` is meant to be a nicer exposed function for users of this lib to validate that their pathnames are valid before pipping it through the TarStream, over exposing parsePathname where the user may be confused about what to do with the result.

* adjust(archive): to use `Date.now()` instead of `new Date().getTime()`

Co-authored-by: ud2 <sjx233@qq.com>

* adjust(archive): mode, uid, and gid to be numbers instead of strings when Untaring

* tests(archive): adjust two tests to also validate the contents of the files are valid

* adjust(archive): linkname, uname, and gname to follow the same decoding rules as name and prefix

* rename(archive): UnTarStream to UntarStream

* fix(archive): type that was missed getting updated

* tests(archive): adjust check headers test to validate all header properties instead of just pathnames

* rename(archive): `pathname` properties to `path`

* docs(archive): updated to be more descriptive

* docs(archive): Updated error types

* adjust(archive): `validPath` to `assertValidPath`

* adjust(archive): `validTarStreamOptions` to `assertValidTarStreamOptions`

* revert(archive): UntarStream to produce TarStreamEntry instead of TarStreamChunk

* refactor: remove redundant `void` return types

* docs: cleanup assertion function docs

* docs: correct `TarStream` example

* docs: minor docs cleanups

* refactor: improve error class specificity

* docs: add `@experimental` JSDoc tags

* docs(archive): Updated examples for `assertValidPath` and `assertValidTarStreamOptions```

* fix(archive): problem with tests

- I suspect the problem is that a file that was read by `Deno.readDir` changed size between being read at `Deno.stat` and when `Deno.open` finished pulling it all in.

* update error messages

* update error messages

* fix typos

* refactor: tweak error messages

* refactor: tweaks and add type field

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: ud2 <sjx233@qq.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-09-02 17:43:22 +10:00
denobot
2b3683b6fb
chore: release 2024.08.26 (#5824)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-08-26 17:33:29 +09:00
Asher Gomez
dea7d7701a
docs(archive,assert,cache,cli,encoding,html,http,net,streams,text): remove unstable Markdown alert (#5672)
* docs(archive,cli,html,http,net,streams,text): remove unstable Markdown alert

* update

* fix

* update

* fmt

* fix
2024-08-22 02:55:17 -04:00
Ian Bull
70011e9155
refactor(archive,cache,datetime,fmt,front-matter): align error messages to the style guide (#5706)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-08-21 14:42:02 +09:00
Asher Gomez
d6fde648e2
docs(archive): complete documentation (#5636)
* docs(archive): complete documentation

* work

* work

* work

* work

* fixes
2024-08-20 17:13:54 +10:00
Asher Gomez
1047864eda
refactor(io): cleanup BufferFullError and PartialReadError logic (#5657)
* refactor(io): define `BufferFullError` name in constructor

* fix

* work

* work
2024-08-08 22:31:06 +09:00
denobot
ce02d496a4
chore: release 2024.08.07 (#5650)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-08-07 21:42:08 +09:00
Asher Gomez
4432ba1c1b
fix(archive): make data property private in Tar (#5645) 2024-08-07 18:20:29 +09:00
Asher Gomez
5e2d065e08
fix(archive): make block and reader properties in Untar private (#5637)
* fix(archive): make `block` and `reader` properties in `Untar` private

* fix
2024-08-06 14:52:37 +00:00
Asher Gomez
889a63de2e
docs(archive): mark public APIs as unstable/experimental (#5639)
* BREAKING(archive): remove `TarEntry.#header`

* docs(archive): mark public APIs as unstable/experimental
2024-08-06 12:41:59 +00:00
Asher Gomez
d32deb73dd
BREAKING(archive): remove TarEntry.#header (#5638) 2024-08-06 21:37:22 +09:00
denobot
940568c62d
chore: release 2024.07.02 (#5254)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-07-02 20:43:42 +09:00
familyboat
4619560a61
test(archive): fix typo in tar_test.ts (#5196)
docs(archive): fix typo in `tar_test.ts`
2024-06-30 14:26:14 +10:00
Yoshiya Hinosawa
365f989bde
chore: ignore test utils in coverage reporting (#5133) 2024-06-25 16:35:00 +09:00
denobot
7d1d9cc34a
chore: release 2024.06.21 (#5107)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-06-21 19:15:49 +09:00
Madhav Ganesan
ab458a38fa
refactor(archive,expect,io,log,toml,yaml): remove private and public access modifiers (#5077)
* replaced public and private access modifiers #5066

* fix: run `deno fmt`

* fix: apply suggestions

* fix

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-06-21 14:13:08 +10:00
denobot
0ea4868542
chore: release 2024.06.06 (#4984)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2024-06-06 20:26:57 +09:00
Asher Gomez
2e54f46670
refactor(archive): cleanup use of @std/assert (#4975)
* refactor(archive): cleanup use of `@std/assert`

* update graph
2024-06-05 21:52:06 +00:00
Yoshiya Hinosawa
3155f0050a
chore: switch to JSR-oriented codebase (#4650) 2024-04-29 11:57:30 +09:00
Marvin Hagemeister
116c54a428
chore: fix lint error in canary (#4513)
chore: fix lint
2024-03-22 21:27:04 +01:00
Gabriele Belluardo
9d5011ed3d
fix(tar): leak in Tar() checks directory entry type test (#4490) 2024-03-15 05:35:15 +11:00
Asher Gomez
d63e97c735
docs(archive): further documentation (#4462)
docs(archive): complete documentation
2024-03-11 20:52:36 +11:00
Asher Gomez
bdada09466
refactor(archive): various cleanups (#4463) 2024-03-11 20:31:25 +11:00
David Sherret
b72ec0651e
chore: latest verbatim-module-syntax fixes (#4418) 2024-02-29 18:01:26 -05:00
David Sherret
ef6b95f0c7
refactor: make the code work under verbatimModuleSyntax (#4406)
* Start

* Update

* Format

* Revert deno.json change

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-02-27 21:57:25 +00:00
Asher Gomez
5b0ff30bbf
refactor: cleanup deprecated-related APIs in std/io and std/streams (#4201) 2024-01-15 13:23:04 +09:00
Anwesh
3fcb0a8b24
refactor(using): use using keyword for Explicit Resource Management (#4143)
* refactor(using): add using keyword for Explicit Resource Management

* refactor(using): fix fmt

* refactor(using): add more fixes

* refactor(using): fix fmt

* refactor: add more `using` cases

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-01-15 08:35:50 +11:00
Asher Gomez
a9fe1603e0
feat(io): re-introduce IO functions (#4128) 2024-01-12 18:34:12 +11:00
Asher Gomez
22fba79092
deprecation(io): move types file (#4133) 2024-01-09 16:14:28 +11:00
Simon Holloway
efb3866571
refactor(archive): prepare for noUncheckedIndexedAccess (#4110)
* refactor(archive): prepare for noUncheckedIndexedAccess

* adjust test to handle new TarHeader requirements
2024-01-08 15:58:59 +11:00
Lino Le Van
c46143f0ac
chore: update copyright year (#4046)
* chore: update copyright year

* fix

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-01-02 08:11:32 +11:00
Tim Reichen
228d29e5fa
refactor(archive): format test names (#3984)
* initial commit

* chore

* update test names

* tweaks

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-12-19 09:21:01 +11:00
Asher Gomez
451efa6243
deprecation: move types.d.ts to std/io (#3885)
* deprecation: move `types.d.ts` to `std/io`

* fix
2023-12-01 11:46:43 +09:00
Asher Gomez
56e2bc10e0
chore: use Array.fromAsync() where possible (#3788) 2023-11-11 06:00:28 +11:00
Carl W. Irving
c7b94e3e7d
fix(archive/untar.ts): cannot access symlinks in archives (#3686) 2023-10-06 15:33:36 +09:00
Chris Knight
7fc5cdacab
docs(archive): improve docs and general code cleanup (#3593) 2023-08-31 18:00:41 +09:00
Lino Le Van
2b5d71224f
refactor: cleanup usage of double equals (#3566)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-08-25 18:04:43 +09:00
Asher Gomez
239e85ad6a
BREAKING(testing, assert): move std/testing/asserts to std/assert (#3445) 2023-07-13 16:04:30 +09:00
familyboat
8ee7766677
refactor(archive/tar): improve clean function (#3431)
Co-authored-by: familyboat <familyboat@163.com>
2023-06-07 20:37:10 +09:00
Asher Gomez
a11c957053
chore(streams, archive): remove deprecated exports (#3107) 2023-01-14 19:10:03 +09:00
ayame113
b4239898d6
chore: update copyright header (#3082) 2023-01-03 19:47:44 +09:00
Asher Gomez
22cdb7f0fc
refactor(archive): rework single-export files (#3060) 2022-12-27 13:38:03 +09:00
Asher Gomez
2f9baf6794
refactor: remove Deno namespace IO types (#3030) 2022-12-23 14:33:12 +09:00
Asher Gomez
ae3663e74c
chore: move deprecated removal versions back (#3032) 2022-12-22 17:01:00 +09:00
Asher Gomez
c78061eef3
refactor: replace String.prototype.substr() with String.prototype.slice() (#2993) 2022-12-12 15:21:59 +09:00
Asher Gomez
259d5a71e2
BREAKING(archive): move to single-export files (#2958) 2022-12-04 20:41:50 +09:00
Asher Gomez
5dabeb2d91
refactor(streams): move to single-export files (#2957) 2022-11-29 08:55:38 -05:00
Leo Kettmeir
aba5017d43
docs: reorganize docs (#2658) 2022-11-25 12:40:23 +01:00
Asher Gomez
792f1334fe
refactor: use _util/asserts.ts for non-test code (#2857) 2022-11-10 16:28:20 +09:00