Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added new date wrapper #1627

Merged
merged 197 commits into from
Feb 26, 2024

Conversation

petertonysmith94
Copy link
Contributor

@petertonysmith94 petertonysmith94 commented Jan 10, 2024

Closes #1573

Changes made

  • Added DateTime class, which enables conversion to and from timestamps based in the following formats Tai64 and Unix.
  • Added documentation around the conversion of common time formats.
  • Removed the tai64 package dependency.

Known limitations

There were two implementations available with the codebase:

  • Package tai64 (npm)
  • Custom implementation using BigInt and a constant "leap second" offset.

This leap second offset will need to be updated, this is how the the tai64 package handles this implementation.

I have gone with the custom implementation as it's more lightweight, favouring consolidating to a single solution and
using BigInt to follow the general goals of this community (#1542).

arboleya and others added 30 commits December 8, 2023 16:43
* docs: purge hardcoded snippets on 'using typegen' page

* Update .gitignore

* delete typegen files

* fix formatting

* update ignore files

* refactor package.json

* fix author

Co-authored-by: Cameron Manavian <cameron.manavian@fuel.sh>

* fix author

Co-authored-by: Cameron Manavian <cameron.manavian@fuel.sh>

* update predicate test

* fix failing predicate test

* Fix authors

* add gasLimit

* update gas limit

---------

Co-authored-by: Cameron Manavian <cameron.manavian@fuel.sh>
Co-authored-by: Daniel Bate <djbate23@gmail.com>
* Revert "feat: add `Predicate.getTransferTxId` helper (FuelLabs#1467)"

This reverts commit 70233c1.

* chore: add rc workflow

* chore: changeset

* chore: change rc workflow name

* chore: fix rc version

* chore: remove workflow dispatch for rc worjflow

* chore: add correct rc naming

* chore: use correct branch filtering

* chore: linting

* chore: alter branch name env

* chore: change pull request to push

* feat: set correct rc versiuon in worflow

* feat: add echo rc verison

* chore: test ci

* chore: test ci

* chore: echo changesets

* chore: use env in rc changeset

* test dan release

* chore: enable pr release

* chore: copy pr relase

* try rc nam,e

* use salamander

* chore: use rc name

* use: salamander

* chore: test salamander

* chore: fix workflow trigger

* chore: remove env rc name

* chore: update rc suffix

---------

Co-authored-by: Anderson Arboleya <anderson@arboleya.me>
* chore: fix string replace

* chore: changeset
…uelLabs#1520)

* docs: Updated high-level doc links in README files

* docs: updating "/guide/" based doc hyperlinks

* docs: update "/sway/" and "/forc/" related doc urls

* docs: update "fuels-rs" doc links

* docs: update quickstart doc links

* docs: updated the quickstart docs link

* docs: added the changeset

---------

Co-authored-by: Anderson Arboleya <anderson@arboleya.me>
* chore: pin graphql request version

* chore: changeset
* chore: upgrade tsx

* chore: remove redundant script

* chore: changeset
* Setting up

* Adjusting tests from `packages/address`

* Adjusting tests from `packages/abi-typegen`

* Forgotten files

* Adjusting scripts

* Touchups

* Adjusting script

* Touchups

* Adjusting tests for `packages/crypto`

* Adjusting tests for `packages/errors`

* feat: implement coverage merging, reporting. Also in test workflow with test validation

* feat: migration of functionalities from vitest

* feat: further config change to implement vitest

* feat: some jest -> vitest syntax migration

* feat: migrate jest spys to vite

* feat: add todo vitest mocks

* feat: upgrade lodash and ethers in hasher package

* feat: install buffer for tests

* feat: add vite env and browser config

* chore: lint

* feat: add missing test groups

* feat: implement check tests module

* chore: update lock file

* feat: add missing test env tags

* chore: regen lock file

* feat: migrate jest mocks to vite in providers

* feat: add ts expect error for browser test for browser apis

* feat: add missing vite restore mocks to provider test

* feat: replace provider mocks with vite compatible mocks

* feat: reenable env specific tests

* feat: enable ts dom lib

* efat: remove ts expect error for browser apis

* feat: fallback to first faucet for vite env

* feat: move vite config files to ts

* feat: polyfill node apis

* feat: uninstall buffer in place of browser polyfill

* feat: remove node process import from vite env

* feat: remove vi import from vite env

* feat: example commit with hasher hardlinked

* chore: regen lock file

* feat: migrate all jest mocking and fix all node tests

* chore: remove redundant snapshots

* feat: add ts expect error for vite mocks

* feat: add node group tags to all tests

* feat: symlink fuels hasher deps

* chore: regen lock file

* feat: fix test groups

* feat: remove redundant process dep

* feat: migrate to vite hooks in typegen test

* feat: alter coverage reporters

* feat: add missing test group

* feat: reduce pnpm test commands and simplify test scripts

* feat: remove browser test stage from test workflow

* feat: implement browser test command

* feat: alter docs that reference jest

* chore: changeset

* feat: fix doc snippets

* feat: don't run rewrite scripts inside vitest

* feat: fix doc snippet tags

* feat: add missing tsdoc files

* feat: remove redundant imports

* chore: linting

* feat: remove workflow from download artifact action in gh workflow

* feat: alter test workflow

* feat: add support for live node tests in vitest

* feat: use different workflow download action

* feat: fix check tests to find all tests

* feat: migrate jest to vi in provider tests

* feat: fix provider mock in provider unit test

* feat: add e2e to all find tests flag

* feat: remove process define in place of polyfill plugin

* feat: rename tests coverage script functions

* feat: fix vitest mock in mock versions test

* feat: reintroduce hasher tests

* feat: update test contribution docs

* feat: rename coverage commands

* feat: add missing test groups

* chore: force rebuild

* feat: add test and coverage exclusions

* feat: reitroduce coverage flags

* feat: add missing test group

* feat: remove file from master merge

* feat: use more updated lcov workflow action

* chore: rebuild

* feat: use old coverage report action

* feat: move test CI setup to a composite action

* feat: reimplement checkout to test CI

* feat: add shell to test setup CI action

* chore: force rebuild

* feat: fix test ci

* feat: create test setup action

* feat: implement coverage diff script and PR comment action

* feat: resolve issue in previous merge conflict

* feat: add missing test envs

* feat: remove temp test ci stage

* feat: alter find tests script to produce new diff

* feat: alter find tests script to produce new diff

* feat: recreate coverage PR comment

* feat: fix find test script

* Adjusting new tests (merged from master) to vite

* Adding missing test’s group tag

* chore: regen lock file

* feat: restore contents of crypto

* feat: fix crypto test mocks

* feat: fix shell js refactors

* feat: implement filter tests command

* feat: isolate browser tests

* feat: migrate test validate script to sh

* feat: remove browser test stages from test workflow

* feat: rename gen coverage script to merge coverage

* feat: rollback crypto types change

* feat: fix browser types

* feat: remove redundant test workflow step

* chore: linting

* feat: add missing crypto tsdoc file

* feat: improve test ci stage names

* feat: remove test that was brought in merge

* feat: migrate fuels cli work to vitest

* chore: linting

* feat: implement test matrix to speed up builds

* feat: rename test matrix stage

* chore: linting

* Moving fixtures around

* Revamping test utilities

* Updating gitignore

* Re-stitching files for `build` command

* Re-stitching files for `dev` command

* Re-stitching core cli files

* Fixing broken mocks

* Refactoring all feature tests

* Fixing all broken unit tests

* Adding missing units

* Re-enabling convenient html report generation

* Re-position flag appropriately

* Ensuring method interruption

* Setting up cleanup hook

* Removing useless method call

* Lintfix

* Adjusting hook timing

* Adding [missing] test group tag

* Adjusting mocks’ restoration

* Lintfix

* Fixing tsconfig

* Fixing test mocks

* Lintfix

* Experimenting with a bigger timeout on long-running tests

* Removing unused import

* chore: force rebuild

* feat: rename test ci stages

* chore: update changeset

Co-authored-by: Nedim Salkić <nedim.salkic@fuel.sh>

* feat: change test workflow stage names

* feat: reintroduce test step

* feat: improve diff text

* feat: add missing test grouops

* chore: spelling

* chore: fix unused imports

* chore: linting

* chore: upgrade vite, vitest and deps

* chore: remove unused ts expect errors

* test: fix import

* test: update hbs assertion

* test: fix forc project mocks

* test: fix hbs assertion

* test: fix ethers mock

* test: add missing test groups

* feat: ignore apps/docs in vite

* chore: update lock

* test: update math mock in provider test

* test: fix math mock

* chore: update lock

* chore: rebuild

* chore: update lock

* chore: pin graphql request version

* chore: regen lock

* chore: migrate to vite mts

* test: resolve fuels mocks

* test: add missing group

* chore: DRY build sway programs test

* test: remve invalid jest calls

* chore: rebuild

* chore: upgrade vite deps

* chore: allocate more memory to test workflow

* chore: rebuild

* chore: add nyc excluded

* chore: increase exclusions

* chore: alter merge report

* chore: alter test runner

* chore: add coverage includes

* chore: try without max mem size in CI

* chore: rebuild

---------

Co-authored-by: Anderson Arboleya <anderson@arboleya.me>
Co-authored-by: Daniel Bate <--global>
Co-authored-by: Nedim Salkić <nedim.salkic@fuel.sh>
* chore: changeset

* chore: use int array for temp stage

* chore: fix conditional workflow
* chore: update node engine in create fuels

* chore: changeset
danielbate
danielbate previously approved these changes Feb 23, 2024
Copy link
Contributor

@danielbate danielbate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻 Just one comment around docs but see what others think around the additional verbosity.

Torres-ssf
Torres-ssf previously approved these changes Feb 23, 2024
arboleya
arboleya previously approved these changes Feb 23, 2024
Copy link
Member

@arboleya arboleya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for yet another contribution! 🙌

packages/utils/src/utils/date-time.test.ts Outdated Show resolved Hide resolved
@petertonysmith94
Copy link
Contributor Author

Hey @Dhaiwat10 and @nedsalk,

I've hopefully addressed all the comments now, thank you for the eyes on! 👀 Please could you take another peek when you have a minute or two, I would be eternally grateful 🙏🏼

@petertonysmith94
Copy link
Contributor Author

Screenshot 2024-02-26 at 21 03 40

Anyone with write access that would/could - pretty please 🍒 merge this into master 🦖

@arboleya arboleya merged commit 30e21d1 into FuelLabs:master Feb 26, 2024
13 checks passed
@petertonysmith94
Copy link
Contributor Author

@arboleya thank you

@petertonysmith94 petertonysmith94 deleted the ps/feat/new-date-wrapper branch February 26, 2024 21:12
@arboleya
Copy link
Member

@petertonysmith94 Thanks again for another PR! 1️⃣➕

hbrooks added a commit to ellipsis-dev/fuels-ts that referenced this pull request Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Issue is a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new Date Wrapper
7 participants