Skip to content

Commit

Permalink
📦 chore: Move resolutions to it's own package (#605)
Browse files Browse the repository at this point in the history
## Description

Move resolutions to it's own package

## Testing

Explain the quality checks that have been done on the code changes

## Additional Information

- [ ] I read the [contributing docs](../docs/contributing.md) (if this
is your first contribution)

Your ENS/address:

---------

Co-authored-by: Will Cory <[email protected]>
  • Loading branch information
roninjin10 and Will Cory authored Oct 24, 2023
1 parent 43d6702 commit ddcfaa7
Show file tree
Hide file tree
Showing 54 changed files with 1,476 additions and 51 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,9 @@ jobs:
with:
name: "@evmts/unplugin"
working-directory: "./bundlers/unplugin"
- name: 'Report @evmts/resolutions Coverage'
if: always() # Also generate the report if tests are failing
uses: davelosert/vitest-coverage-report-action@v2
with:
name: "@evmts/resolutions"
working-directory: "./resolutions"
Binary file modified bun.lockb
Binary file not shown.
4 changes: 1 addition & 3 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@
"outputsDist": [
{ "dependentTasksOutputFiles": "**/*", "transitive": true }
],
"outputsDts": [
{ "dependentTasksOutputFiles": "**/types/**/*", "transitive": true }
],
"outputsDts": [{ "dependentTasksOutputFiles": "**/*", "transitive": true }],
"testing": ["configsWorkspace", "default"]
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"docs",
"e2e",
"effect",
"resolutions",
"runtime",
"solc",
"schemas",
Expand Down
1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ packages:
- "runtime"
- "schemas"
- "revm"
- "resolutions"
- "schemas"
- "solc"
- "state"
Expand Down
50 changes: 50 additions & 0 deletions resolutions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.env

cache
forge-artifacts
broadcast
types

# compiled output
dist
packages/*/dist
tmp
/out-tsc
**/tsconfig.tsbuildinfo

# dependencies
node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

**/lcov.info

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db

# My personal files
.zshrc
361 changes: 361 additions & 0 deletions resolutions/CHANGELOG.md

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions resolutions/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(The MIT License)

Copyright 2020-2022

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 changes: 31 additions & 0 deletions resolutions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<p align="center">
<a href="https://evmts.dev/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/35039927/218812217-92f0f784-cb85-43b9-9ca6-e2b9effd9eb2.png">
<img alt="wagmi logo" src="https://user-images.githubusercontent.com/35039927/218812217-92f0f784-cb85-43b9-9ca6-e2b9effd9eb2.png" width="auto" height="300">
</picture>
</a>
</p>

<p align="center">
Execute solidity scripts in browser
</p>

[![CI](https://github.com/evmts/evmts-monorepo/actions/workflows/e2e.yml/badge.svg)](https://github.com/evmts/evmts-monorepo/actions/workflows/e2e.yml)
[![CI](https://github.com/evmts/evmts-monorepo/actions/workflows/unit.yml/badge.svg)](https://github.com/evmts/evmts-monorepo/actions/workflows/unit.yml)
<a href="https://www.npmjs.com/package/@evmts/resolutions" target="\_parent">
<img alt="" src="https://img.shields.io/npm/dm/@evmts/resolutions.svg" />
</a>
<a href="https://bundlephobia.com/package/@evmts/resolutions@latest" target="\_parent">
<img alt="" src="https://badgen.net/bundlephobia/minzip/@evmts/resolutions" />
</a>

# @evmts/resolutions

Package to resolve the import graph for solidity packages

Generated docs at [./docs](./docs)

## License 📄

<a href="./LICENSE"><img src="https://user-images.githubusercontent.com/35039927/231030761-66f5ce58-a4e9-4695-b1fe-255b1bceac92.png" width="200" /></a>
129 changes: 129 additions & 0 deletions resolutions/TestContract.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
import { EvmtsContract } from '@evmts/core'
const _abiTestContract = [
{
constant: true,
inputs: [],
name: 'name',
outputs: [{ name: '', type: 'string' }],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: false,
inputs: [
{ name: '_spender', type: 'address' },
{ name: '_value', type: 'uint256' },
],
name: 'approve',
outputs: [{ name: '', type: 'bool' }],
payable: false,
stateMutability: 'nonpayable',
type: 'function',
},
{
constant: true,
inputs: [],
name: 'totalSupply',
outputs: [{ name: '', type: 'uint256' }],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: false,
inputs: [
{ name: '_from', type: 'address' },
{ name: '_to', type: 'address' },
{ name: '_value', type: 'uint256' },
],
name: 'transferFrom',
outputs: [{ name: '', type: 'bool' }],
payable: false,
stateMutability: 'nonpayable',
type: 'function',
},
{
constant: true,
inputs: [],
name: 'decimals',
outputs: [{ name: '', type: 'uint8' }],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [{ name: '_owner', type: 'address' }],
name: 'balanceOf',
outputs: [{ name: 'balance', type: 'uint256' }],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [],
name: 'symbol',
outputs: [{ name: '', type: 'string' }],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: false,
inputs: [
{ name: '_to', type: 'address' },
{ name: '_value', type: 'uint256' },
],
name: 'transfer',
outputs: [{ name: '', type: 'bool' }],
payable: false,
stateMutability: 'nonpayable',
type: 'function',
},
{
constant: true,
inputs: [
{ name: '_owner', type: 'address' },
{ name: '_spender', type: 'address' },
],
name: 'allowance',
outputs: [{ name: '', type: 'uint256' }],
payable: false,
stateMutability: 'view',
type: 'function',
},
{ payable: true, stateMutability: 'payable', type: 'fallback' },
{
anonymous: false,
inputs: [
{ indexed: true, name: 'owner', type: 'address' },
{ indexed: true, name: 'spender', type: 'address' },
{ indexed: false, name: 'value', type: 'uint256' },
],
name: 'Approval',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, name: 'from', type: 'address' },
{ indexed: true, name: 'to', type: 'address' },
{ indexed: false, name: 'value', type: 'uint256' },
],
name: 'Transfer',
type: 'event',
},
] as const
const _chainAddressMapTestContract = { '10': '0x123' } as const
const _nameTestContract = 'TestContract' as const
/**
* TestContract EvmtsContract
* @etherscan-10 https://optimistic.etherscan.io/address/0x123
*/
export const TestContract: EvmtsContract<
typeof _nameTestContract,
typeof _chainAddressMapTestContract,
typeof _abiTestContract
>
1 change: 1 addition & 0 deletions resolutions/docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
33 changes: 33 additions & 0 deletions resolutions/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@evmts/resolutions / [Exports](modules.md)

<p align="center">
<a href="https://evmts.dev/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/35039927/218812217-92f0f784-cb85-43b9-9ca6-e2b9effd9eb2.png">
<img alt="wagmi logo" src="https://user-images.githubusercontent.com/35039927/218812217-92f0f784-cb85-43b9-9ca6-e2b9effd9eb2.png" width="auto" height="300">
</picture>
</a>
</p>

<p align="center">
Execute solidity scripts in browser
</p>

[![CI](https://github.com/evmts/evmts-monorepo/actions/workflows/e2e.yml/badge.svg)](https://github.com/evmts/evmts-monorepo/actions/workflows/e2e.yml)
[![CI](https://github.com/evmts/evmts-monorepo/actions/workflows/unit.yml/badge.svg)](https://github.com/evmts/evmts-monorepo/actions/workflows/unit.yml)
<a href="https://www.npmjs.com/package/@evmts/resolutions" target="\_parent">
<img alt="" src="https://img.shields.io/npm/dm/@evmts/resolutions.svg" />
</a>
<a href="https://bundlephobia.com/package/@evmts/resolutions@latest" target="\_parent">
<img alt="" src="https://badgen.net/bundlephobia/minzip/@evmts/resolutions" />
</a>

# @evmts/resolutions

Package to resolve the import graph for solidity packages

Generated docs at [./docs](./docs)

## License 📄

<a href="./LICENSE"><img src="https://user-images.githubusercontent.com/35039927/231030761-66f5ce58-a4e9-4695-b1fe-255b1bceac92.png" width="200" /></a>
69 changes: 69 additions & 0 deletions resolutions/docs/interfaces/ModuleInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[@evmts/resolutions](../README.md) / [Exports](../modules.md) / ModuleInfo

# Interface: ModuleInfo

Copied from rollup (kinda)

**`See`**

https://rollupjs.org/plugin-development/#this-getmoduleinfo

## Table of contents

### Properties

- [code](ModuleInfo.md#code)
- [id](ModuleInfo.md#id)
- [importedIds](ModuleInfo.md#importedids)
- [rawCode](ModuleInfo.md#rawcode)
- [resolutions](ModuleInfo.md#resolutions)

## Properties

### code

**code**: ``null`` \| `string`

#### Defined in

[types.ts:20](https://github.com/evmts/evmts-monorepo/blob/main/resolutions/src/types.ts#L20)

___

### id

**id**: `string`

#### Defined in

[types.ts:18](https://github.com/evmts/evmts-monorepo/blob/main/resolutions/src/types.ts#L18)

___

### importedIds

**importedIds**: `string`[]

#### Defined in

[types.ts:21](https://github.com/evmts/evmts-monorepo/blob/main/resolutions/src/types.ts#L21)

___

### rawCode

**rawCode**: ``null`` \| `string`

#### Defined in

[types.ts:19](https://github.com/evmts/evmts-monorepo/blob/main/resolutions/src/types.ts#L19)

___

### resolutions

**resolutions**: [`ModuleInfo`](ModuleInfo.md)[]

#### Defined in

[types.ts:22](https://github.com/evmts/evmts-monorepo/blob/main/resolutions/src/types.ts#L22)
Loading

1 comment on commit ddcfaa7

@vercel
Copy link

@vercel vercel bot commented on ddcfaa7 Oct 24, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

evmts-docs – ./

evmts-docs-evmts.vercel.app
evmts-docs-git-main-evmts.vercel.app
evmts.dev

Please sign in to comment.