-
Notifications
You must be signed in to change notification settings - Fork 29
feat: @ckb-ccc/molecule #210
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1dd0da8
feat: @ckb-ccc/molecule
Alive24 b0336c1
feat: molecule demo
Alive24 756ad5d
fix: revision for #210
Alive24 38c4e95
fix: second revision on for #210
Alive24 77865cd
feat: compatible mode for molecule decode (#209)
Alive24 03abd46
feat: @ckb-ccc/molecule
Alive24 ef526f3
feat: molecule demo
Alive24 54a6b53
fix: revision for #210
Alive24 89f7a1c
fix: second revision on for #210
Alive24 807aef4
Merge branch 'feat-molecule' of https://github.com/Alive24/ccc into f…
Alive24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,21 @@ | ||
node_modules/ | ||
misc/ | ||
|
||
*test.js | ||
*test.ts | ||
*test.d.ts | ||
*test.d.ts.map | ||
*spec.js | ||
*spec.ts | ||
*spec.d.ts | ||
*spec.d.ts.map | ||
|
||
tsconfig.json | ||
tsconfig.*.json | ||
eslint.config.mjs | ||
.prettierrc | ||
.prettierignore | ||
|
||
tsconfig.tsbuildinfo | ||
tsconfig.*.tsbuildinfo | ||
.github/ |
This file contains hidden or 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 @@ | ||
node_modules/ | ||
|
||
dist/ | ||
dist.commonjs/ | ||
|
||
.npmignore | ||
.prettierrc | ||
tsconfig.json | ||
eslint.config.mjs | ||
.prettierrc | ||
|
||
tsconfig.tsbuildinfo | ||
.github/ |
This file contains hidden or 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,5 @@ | ||
{ | ||
"singleQuote": false, | ||
"trailingComma": "all", | ||
"plugins": ["prettier-plugin-organize-imports"] | ||
} |
This file contains hidden or 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,43 @@ | ||
<p align="center"> | ||
<a href="https://app.ckbccc.com/"> | ||
<img alt="Logo" src="https://raw.githubusercontent.com/ckb-devrel/ccc/master/assets/logoAndText.svg" style="height: 8rem; max-width: 90%; padding: 0.5rem 0;" /> | ||
</a> | ||
</p> | ||
|
||
<h1 align="center" style="font-size: 48px;"> | ||
CCC's Support for Molecule | ||
</h1> | ||
|
||
<p align="center"> | ||
<a href="https://www.npmjs.com/package/@ckb-ccc/ssri"><img | ||
alt="NPM Version" src="https://img.shields.io/npm/v/%40ckb-ccc%2Fssri" | ||
/></a> | ||
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/ckb-devrel/ccc" /> | ||
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/ckb-devrel/ccc/master" /> | ||
<img alt="GitHub branch check runs" src="https://img.shields.io/github/check-runs/ckb-devrel/ccc/master" /> | ||
<a href="https://live.ckbccc.com/"><img | ||
alt="Playground" src="https://img.shields.io/website?url=https%3A%2F%2Flive.ckbccc.com%2F&label=Playground" | ||
/></a> | ||
<a href="https://app.ckbccc.com/"><img | ||
alt="App" src="https://img.shields.io/website?url=https%3A%2F%2Fapp.ckbccc.com%2F&label=App" | ||
/></a> | ||
<a href="https://docs.ckbccc.com/"><img | ||
alt="Docs" src="https://img.shields.io/website?url=https%3A%2F%2Fdocs.ckbccc.com%2F&label=Docs" | ||
/></a> | ||
</p> | ||
|
||
<p align="center"> | ||
CCC - CKBers' Codebase is a one-stop solution for your CKB JS/TS ecosystem development. | ||
<br /> | ||
Empower yourself with CCC to discover the unlimited potential of CKB. | ||
<br /> | ||
Interoperate with wallets from different chain ecosystems. | ||
<br /> | ||
Fully enabling CKB's Turing completeness and cryptographic freedom power. | ||
</p> | ||
|
||
Get `CodecMap` from Molecule schema. | ||
|
||
<h3 align="center"> | ||
Read more about CCC on <a href="https://docs.ckbccc.com">our website</a> or <a href="https://github.com/ckb-devrel/ccc">GitHub Repo</a>. | ||
</h3> |
This file contains hidden or 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,50 @@ | ||
// @ts-check | ||
|
||
import eslint from "@eslint/js"; | ||
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; | ||
import tseslint from "typescript-eslint"; | ||
|
||
import { dirname } from "path"; | ||
import { fileURLToPath } from "url"; | ||
|
||
export default [ | ||
{ | ||
ignores: ["**/grammar.js"], | ||
}, | ||
...tseslint.config({ | ||
files: ["**/*.ts"], | ||
extends: [ | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommendedTypeChecked, | ||
], | ||
rules: { | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
args: "all", | ||
argsIgnorePattern: "^_", | ||
caughtErrors: "all", | ||
caughtErrorsIgnorePattern: "^_", | ||
destructuredArrayIgnorePattern: "^_", | ||
varsIgnorePattern: "^_", | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
"@typescript-eslint/unbound-method": ["error", { ignoreStatic: true }], | ||
"@typescript-eslint/no-unsafe-member-access": "off", | ||
"@typescript-eslint/require-await": "off", | ||
"no-empty": "off", | ||
"prefer-const": [ | ||
"error", | ||
{ ignoreReadBeforeAssign: true, destructuring: "all" }, | ||
], | ||
}, | ||
languageOptions: { | ||
parserOptions: { | ||
project: true, | ||
tsconfigRootDir: dirname(fileURLToPath(import.meta.url)), | ||
}, | ||
}, | ||
}), | ||
eslintPluginPrettierRecommended, | ||
]; |
This file contains hidden or 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,14 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
testMatch: ["**/*.spec.ts"], | ||
moduleFileExtensions: ["ts", "js", "json", "peggy", "node"], | ||
transform: { | ||
"^.+\\.ts$": ["ts-jest", { tsconfig: "tsconfig.json" }], | ||
"^.+\\.peggy$": [ | ||
"<rootDir>/peggy-transformer.js", | ||
{ tsconfig: "tsconfig.json" }, | ||
], | ||
}, | ||
}; |
This file contains hidden or 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,60 @@ | ||
{ | ||
"name": "@ckb-ccc/molecule", | ||
"version": "0.0.1", | ||
"description": "Molecule parser for CKB", | ||
"author": "Alive24 <xct24@live.com>", | ||
"homepage": "https://github.com/ckb-devrel/ccc", | ||
"license": "MIT", | ||
"main": "./dist.commonjs/index.js", | ||
"module": "./dist/index.js", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.js", | ||
"default": "./dist.commonjs/index.js" | ||
}, | ||
"./barrel": { | ||
"import": "./dist/barrel.js", | ||
"default": "./dist.commonjs/barrel.js" | ||
} | ||
}, | ||
"private": false, | ||
"engines": { | ||
"node": ">=12.0.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ckb-devrel/ccc.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/ckb-devrel/ccc/issues" | ||
}, | ||
"scripts": { | ||
"test": "jest", | ||
"fmt": "prettier --write \"{src,tests,examples}/**/*.ts\" package.json", | ||
"lint": "eslint ./src", | ||
"build": "rimraf ./dist && rimraf ./dist.commonjs && tsc && tsc --project tsconfig.commonjs.json && copyfiles -u 2 misc/basedirs/**/* .", | ||
"clean": "rm -rf lib" | ||
}, | ||
"dependencies": { | ||
"@ckb-ccc/core": "workspace:*", | ||
"glob": "^10.3.10", | ||
"relative": "^3.0.2" | ||
}, | ||
"devDependencies": { | ||
"@eslint/js": "^9.1.1", | ||
"eslint": "^9.1.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"typescript-eslint": "^7.7.0", | ||
"@types/js-yaml": "^4.0.9", | ||
"copyfiles": "^2.4.1", | ||
"js-yaml": "^4.1.0", | ||
"jsbi": "^4.1.0", | ||
"peggy": "^4.0.3", | ||
"rimraf": "^5.0.5", | ||
"prettier-plugin-organize-imports": "^3.2.4" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains hidden or 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,14 @@ | ||
const peggy = require("peggy"); | ||
|
||
module.exports = { | ||
process(sourceText) { | ||
const parser = peggy.generate(sourceText, { | ||
output: "source", | ||
format: "commonjs", | ||
}); | ||
|
||
return { | ||
code: parser, | ||
}; | ||
}, | ||
}; |
This file contains hidden or 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 @@ | ||
export * from "./molecule"; | ||
export * from "./type"; |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.