This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Introduce new @truffle/codec-components react component library #6076
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
18c4aa6
codec-components: Set-up (manifest, build stuff)
cliffoo afb4328
codec-components: Source, build config and script
cliffoo 688e913
Exclude @truffle/codec-components from depcheck
cliffoo 933f775
codec-components: Format.Errors.* components
cliffoo e8b5f91
codec-components: Format.Values.* components
cliffoo 50a7583
codec-components: Access list components
cliffoo 98fe559
codec-components: Options use AccessList
cliffoo 127b575
codec-components: Anonymous keyword Code type
cliffoo 7662cf3
codec-components: Remove pesky TODO's
cliffoo 9430249
codec-components: Add missing injected node usage
cliffoo 422f719
codec-components: Explicitly set displayName
cliffoo 2262e68
codec-components: 0.1.0-canary-8 release
cliffoo bda3bde
codec-components: Readme
cliffoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/dist | ||
/docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# @truffle/codec-components | ||
cliffoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
This package provides UI (react) components to display `@truffle/codec` values. | ||
|
||
## Install | ||
|
||
```sh | ||
$ npm install --save @truffle/codec-components react react-dom | ||
``` | ||
|
||
## Usage and documentation | ||
|
||
This package is intended for Truffle Dashboard and MetaMask to use at the moment, APIs and documentation are under development to allow more general use cases in the future. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{ | ||
"name": "@truffle/codec-components", | ||
"description": "UI component library for @truffle/codec data", | ||
"version": "0.1.0-canary-8", | ||
"keywords": [ | ||
"solidity", | ||
"ethereum", | ||
"react", | ||
"ui", | ||
"components", | ||
"truffle" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"license": "MIT", | ||
"homepage": "https://github.com/trufflesuite/truffle/tree/develop/packages/codec-components", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/trufflesuite/truffle.git", | ||
"directory": "packages/codec-components" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/trufflesuite/truffle/issues" | ||
}, | ||
"author": "cliffoo <[email protected]>", | ||
"type": "module", | ||
"files": [ | ||
"dist/react/index.{js,js.map,d.ts,css}", | ||
"react.d.ts" | ||
], | ||
"exports": { | ||
"./react": "./dist/react/index.js", | ||
"./react-styles": "./dist/react/index.css" | ||
}, | ||
"scripts": { | ||
"build": "tsc && node ./scripts/build.js", | ||
"dev": "vite", | ||
"docs": "vite build", | ||
"preview": "vite preview", | ||
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0", | ||
"prepare": "yarn build" | ||
}, | ||
"dependencies": { | ||
"@truffle/codec": "^0.15.2" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.35.1", | ||
"@types/big.js": "^6.0.2", | ||
"@types/bn.js": "^5.1.0", | ||
"@types/react": ">=16.9.0", | ||
"@types/react-dom": ">=16.9.0", | ||
"@vitejs/plugin-react": "^4.0.0", | ||
"big.js": "^6.0.3", | ||
"bn.js": "^5.1.3", | ||
"sass": "^1.62.1", | ||
"typescript": "^4.9.5", | ||
"vite": "^4.3.9" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=16.9.0", | ||
"react-dom": ">=16.9.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
"react": { | ||
"optional": true | ||
}, | ||
"react-dom": { | ||
"optional": true | ||
} | ||
}, | ||
"eslintConfig": { | ||
"env": { | ||
"browser": true, | ||
"es2020": true | ||
}, | ||
"extends": [ | ||
"../../.eslintrc.package.json", | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react-hooks/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"@typescript-eslint/no-unused-vars": [ | ||
"warn", | ||
{ | ||
"argsIgnorePattern": "^_" | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Subpath import hack. | ||
export * from "./dist/react/index"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"mainEntryPointFilePath": "../dist/react/index.d.ts", | ||
"dtsRollup": { | ||
"enabled": true, | ||
"untrimmedFilePath": "../dist/react/index.d.ts" | ||
}, | ||
"apiReport": { "enabled": false }, | ||
"docModel": { "enabled": false }, | ||
"tsdocMetadata": { "enabled": false }, | ||
"messages": { | ||
"extractorMessageReporting": { | ||
"ae-forgotten-export": { "logLevel": "none" }, | ||
"ae-missing-release-tag": { "logLevel": "none" } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { build } from "vite"; | ||
import { Extractor, ExtractorConfig } from "@microsoft/api-extractor"; | ||
|
||
(async () => { | ||
const config = ExtractorConfig.loadFileAndPrepare( | ||
"scripts/api-extractor.json" | ||
); | ||
const result = Extractor.invoke(config, { localBuild: true }); | ||
if (!result.succeeded) throw new Error("Failed to rollup declaration files."); | ||
|
||
await build({ | ||
configFile: false, | ||
build: { | ||
lib: { | ||
entry: "src/react/index.ts", | ||
fileName: "react/index", | ||
formats: ["es"] | ||
}, | ||
rollupOptions: { | ||
external: ["react", "react-dom"], | ||
output: { assetFileNames: "react/index[extname]" } | ||
}, | ||
sourcemap: true, | ||
emptyOutDir: false | ||
} | ||
}); | ||
})(); |
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this change need to get removed before we merge this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No because
dependency-check
fails on packages without entry file, and we can't have one.