Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: MetaMask/utils
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v8.1.0
Choose a base ref
...
head repository: MetaMask/utils
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v8.2.0
Choose a head ref
  • 13 commits
  • 23 files changed
  • 8 contributors

Commits on Sep 15, 2023

  1. Configuration menu
    Copy the full SHA
    4589c75 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2023

  1. Bump postcss from 8.4.23 to 8.4.31 (#143)

    Bumps [postcss](https://github.com/postcss/postcss) from 8.4.23 to 8.4.31.
    - [Release notes](https://github.com/postcss/postcss/releases)
    - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
    - [Commits](postcss/postcss@8.4.23...8.4.31)
    
    ---
    updated-dependencies:
    - dependency-name: postcss
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Oct 8, 2023
    Configuration menu
    Copy the full SHA
    d550df6 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2023

  1. Bump @metamask/auto-changelog from 3.2.0 to 3.3.0 (#142)

    * Bump @metamask/auto-changelog from 3.2.0 to 3.3.0
    
    Bumps [@metamask/auto-changelog](https://github.com/MetaMask/auto-changelog) from 3.2.0 to 3.3.0.
    - [Release notes](https://github.com/MetaMask/auto-changelog/releases)
    - [Changelog](https://github.com/MetaMask/auto-changelog/blob/main/CHANGELOG.md)
    - [Commits](MetaMask/auto-changelog@v3.2.0...v3.3.0)
    
    ---
    updated-dependencies:
    - dependency-name: "@metamask/auto-changelog"
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    * yarn dedupe
    
    ---------
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: legobt <6wbvkn0j@anonaddy.me>
    dependabot[bot] and legobeat authored Oct 10, 2023
    Configuration menu
    Copy the full SHA
    b8cf222 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2023

  1. Configuration menu
    Copy the full SHA
    8732f00 View commit details
    Browse the repository at this point in the history
  2. Use tsup for bundling (#144)

    * Use tsup for bundling
    
    * Simplify CI workflows
    
    * Remove unused dependency
    
    * Remove unnecessary config option
    
    * Use `tsc` for generating declarations
    
    * Fix formatting of package.json
    
    * Enable code splitting
    
    * Revert some changes
    Mrtenz authored Oct 16, 2023
    Configuration menu
    Copy the full SHA
    184d425 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2023

  1. Bump @babel/traverse from 7.21.4 to 7.23.2 (#147)

    * Bump @babel/traverse from 7.21.4 to 7.23.2
    
    Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.21.4 to 7.23.2.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)
    
    ---
    updated-dependencies:
    - dependency-name: "@babel/traverse"
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    * yarn dedupe
    
    ---------
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: legobt <6wbvkn0j@anonaddy.me>
    dependabot[bot] and legobeat authored Oct 17, 2023
    Configuration menu
    Copy the full SHA
    739cece View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f5b86cc View commit details
    Browse the repository at this point in the history
  3. Add error utils (#146)

    This commit satisfies a few needs that we have in various projects:
    
    - When catching a throwable from some kind of operation, we want to
      be able to test whether the throwable is an error.
    - Furthermore, since the Error interface in TypeScript is pretty simple,
      we want to be able to test for different properties on an error
      (`code`, `stack`, etc.).
    - We want to wrap an error produced by a lower level part of the system
      with a different message, but preserve the original error using the
      `cause` property (note: this property was added in Node 18, so for
      older Nodes, we use the `pony-cause` library to set this).
    - We want to be able to take a throwable and produce an error that has a
      stacktrace. This is particularly useful for working with the
      `fs.promises` module, which (as of Node 22) [does not produce proper
      stacktraces][1].
    - We want to be able to get a message from a throwable.
    
    [1]: nodejs/node#30944
    
    ---------
    
    Co-authored-by: Jongsun Suh <34228073+MajorLift@users.noreply.github.com>
    Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
    3 people authored Oct 17, 2023
    Configuration menu
    Copy the full SHA
    2263f9b View commit details
    Browse the repository at this point in the history
  4. devDeps: depcheck@^1.4.3->^1.4.7 (#149)

    * devDeps: depcheck@^1.4.3->^1.4.7
    
    * update depcheckrc
    legobeat authored Oct 17, 2023
    Configuration menu
    Copy the full SHA
    d0db51f View commit details
    Browse the repository at this point in the history
  5. Add filesystem utils (#148)

    This commit adds several utility functions that are related to the
    filesystem in some way.
    
    - Most of the functions here are wrappers around basic filesystem
      operations with better error handling. Node's `fs.promises` module is
      somewhat difficult to work with because [the errors it produces lack
      proper stacktraces][1]. The functions that directly use `fs.promises`
      wrap caught errors in order to supply the missing stacktraces.
    - Two functions make it easier to read and write JSON files (with support
      for JSON-compatible interfaces, such as [JSON5][2]).
    - One function, `createSandbox`, is designed to wrap tests that need
      a temporary directory to work within, such as those for a command-line
      tool that makes changes to the filesystem.
    
    Here are places where we currently use these utilities (or something
    like them):
    
    - https://github.com/MetaMask/action-utils/blob/54ddd730746668cb4c1c88b4edfa720cbecf5e32/src/file-utils.ts
    - https://github.com/MetaMask/create-release-branch/blob/3556dee47163c921186051be7a1f3c98e2049db9/src/fs.ts
    - https://github.com/MetaMask/create-release-branch/blob/3556dee47163c921186051be7a1f3c98e2049db9/tests/helpers.ts
    
    One note about these utilities is that they require Node to use and will
    not work in the browser. Because we already create two kinds of bundles,
    one for CommonJS and another ESM, it would be difficult to create a
    second level of bundles, one for Node and another for the browser.
    Instead of requiring more complexity around the bundle configuration,
    this commit instead introduces another way to import the package.
    
    By default, you'll get all exports that are guaranteed to be
    cross-platform. That means that the file utilities won't show up:
    
    ``` typescript
    // ❌
    import { readFile } from "@metamask/utils";
    ```
    
    If you want all of the cross-platform exports plus the Node-specific
    ones, you will have to import "@metamask/utils/node". For instance:
    
    ``` typescript
    // ✅
    import { readFile } from "@metamask/utils/node";
    ```
    
    Note that you will need to use a `moduleResolution` of `nodenext`
    (and not `node`) in your TypeScript project in order to take advantage
    of this.
    
    [1]: nodejs/node#30944
    [2]: https://www.npmjs.com/package/json5
    
    ---
    
    Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
    Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
    3 people authored Oct 17, 2023
    Configuration menu
    Copy the full SHA
    12b5003 View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2023

  1. Add struct utils for validating JSON objects with optional values (#136)

    * Add struct utils for validating JSON objects with optional values
    
    * Add type tests
    
    * Update existing structs to use jsonObject struct
    
    * Add test for coverage
    
    * Fix type of InferWithParams
    
    * Rename to object and exactOptional
    
    * Fix type test
    
    * Remove unused imports
    
    * Rename test names
    
    * Address review comments
    
    * Update src/json.test.ts
    
    Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
    
    * Update src/json.ts
    
    Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
    
    * Update snapshots
    
    * Move some tests
    
    ---------
    
    Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
    Mrtenz and mcmire authored Oct 19, 2023
    Configuration menu
    Copy the full SHA
    0d68084 View commit details
    Browse the repository at this point in the history
  2. Add missing exports for error utilities (#151)

    These exports should have been included in a previous commit but were
    left out.
    mcmire authored Oct 19, 2023
    Configuration menu
    Copy the full SHA
    2f0005a View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2023

  1. 8.2.0 (#150)

    * 8.2.0
    
    * Update CHANGELOG.md
    
    * Add extra PR for error utils
    
    ---------
    
    Co-authored-by: github-actions <github-actions@github.com>
    Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
    Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
    Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
    5 people authored Oct 20, 2023
    Configuration menu
    Copy the full SHA
    9452f88 View commit details
    Browse the repository at this point in the history
Loading