-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor sdk and cli as separate projects
- Loading branch information
Showing
15 changed files
with
830 additions
and
599 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,36 @@ | ||
build | ||
suilend-cli/node_modules | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
**node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
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,38 @@ | ||
{ | ||
"ignorePatterns": ["_generated"], | ||
"extends": [ | ||
"prettier", | ||
"next/core-web-vitals", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"plugins": ["prettier"], | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": "warn", | ||
"@typescript-eslint/no-unused-vars": "warn", | ||
"prettier/prettier": ["error"], | ||
"import/order": [ | ||
"error", | ||
{ | ||
"pathGroups": [], | ||
"groups": [ | ||
"builtin", | ||
"external", | ||
"internal", | ||
"parent", | ||
"sibling", | ||
"index", | ||
"object", | ||
"type" | ||
], | ||
"newlines-between": "always", | ||
"alphabetize": { "order": "asc", "caseInsensitive": true } | ||
} | ||
], | ||
"sort-imports": [ | ||
"error", | ||
{ | ||
"ignoreDeclarationSort": true | ||
} | ||
] | ||
} | ||
} |
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,38 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
dist/ |
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,38 @@ | ||
{ | ||
"name": "@suilend/springsui-cli", | ||
"version": "1.0.0", | ||
"private": true, | ||
"description": "A CLI for interacting with the SpringSui program", | ||
"author": "Suilend", | ||
"license": "MIT", | ||
"main": "./src/index.ts", | ||
"exports": { | ||
".": "./src/index.js" | ||
}, | ||
"types": "./src/index.ts", | ||
"scripts": { | ||
"build": "rm -rf ./dist && bun tsc", | ||
"eslint": "eslint --fix \"./src/**/*.ts\"", | ||
"prettier": "prettier --write \"./src/**/*\"", | ||
"lint": "bun eslint && bun prettier && bun tsc", | ||
"release": "bun run build && bun ts-node ./prepublish.ts && cd ./dist && npm publish --access public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/solendprotocol/liquid-staking.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/solendprotocol/liquid-staking/issues" | ||
}, | ||
"dependencies": { | ||
"@mysten/bcs": "1.1.0", | ||
"@mysten/sui": "1.12.0", | ||
"commander": "^12.1.0", | ||
"uuid": "^9.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.12.7", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.3.3" | ||
} | ||
} |
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,29 @@ | ||
import fs from "fs"; | ||
|
||
// 1. Update package.json | ||
import packageJson from "./package.json"; | ||
const newPackageJson = Object.assign({}, packageJson); | ||
|
||
newPackageJson["private"] = false; | ||
newPackageJson["main"] = "./index.js"; | ||
|
||
const exportsMap: Record<string, string> = { | ||
".": "./index.js", | ||
}; | ||
const files = ( | ||
fs.readdirSync("./dist/", { recursive: true }) as string[] | ||
).filter((file) => file !== "index.js" && file.endsWith(".js")); | ||
for (const file of files) { | ||
const fileName = file.substring( | ||
0, | ||
file.endsWith("index.js") | ||
? file.lastIndexOf("/index.js") | ||
: file.lastIndexOf(".js"), | ||
); | ||
exportsMap[`./${fileName}`] = `./${file}`; | ||
} | ||
newPackageJson["exports"] = exportsMap as any; | ||
|
||
newPackageJson["types"] = "./index.js"; | ||
|
||
fs.writeFileSync("./dist/package.json", JSON.stringify(newPackageJson), "utf8"); |
Oops, something went wrong.