Skip to content

Commit

Permalink
Merge pull request #117 from sCrypt-Inc/add_index
Browse files Browse the repository at this point in the history
Add index
  • Loading branch information
zhfnjust authored Jun 26, 2024
2 parents 73f106c + 1b21988 commit cdae17d
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 16 deletions.
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@ Lastly, you can create an sCrypt library project with the following option:
npx scrypt-cli p --lib my-lib
```

### Install sCrypt in an existing front-end project

Currently only supports projects created by [Create React App](https://create-react-app.dev/)

```sh
npx create-react-app my-app --template typescript
cd my-app
git init && git add . && git commit -m "Initial commit."
npx scrypt-cli init
```


### Compile sCrypt smart contracts

Expand Down
9 changes: 8 additions & 1 deletion templates/counter/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@ tests/
.mocharc-testnet.json
*.md
.prettierrc
.prettierignore
.prettierignore


deploy.ts
tsconfig-scryptTS.json
artifacts/**/*.scrypt
artifacts/**/*.scrypt.map
artifacts/**/*.transformer.json
5 changes: 4 additions & 1 deletion templates/counter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.1.0",
"description": "A demo sCrypt stateful smart contract.",
"author": "",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"prebuild": "npm run clean",
"build": "tsc",
Expand All @@ -17,7 +19,8 @@
"genprivkey": "npx ts-node tests/utils/privateKey.ts",
"lint": "eslint . --ext .js,.ts --fix && prettier --write --ignore-unknown \"**/*\"",
"lint-check": "eslint . --ext .js,.ts && prettier --check --ignore-unknown \"**/*\"",
"prepare": "husky install"
"prepare": "husky install",
"prepublishOnly": "npm run build && npm run compile"
},
"lint-staged": {
"**/*": [
Expand Down
4 changes: 4 additions & 0 deletions templates/counter/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// The things that are being exported here will be able
// to be imported in another package.

export { PROJECT_NAME } from './contracts/PROJECT_NAME'
8 changes: 7 additions & 1 deletion templates/demo-contract/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ tests/
.mocharc-testnet.json
*.md
.prettierrc
.prettierignore
.prettierignore

deploy.ts
tsconfig-scryptTS.json
artifacts/**/*.scrypt
artifacts/**/*.scrypt.map
artifacts/**/*.transformer.json
5 changes: 4 additions & 1 deletion templates/demo-contract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.1.0",
"description": "A demo sCrypt smart contract.",
"author": "",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"prebuild": "npm run clean",
"build": "tsc",
Expand All @@ -17,7 +19,8 @@
"genprivkey": "npx ts-node tests/utils/privateKey.ts",
"lint": "eslint . --ext .js,.ts --fix && prettier --write --ignore-unknown \"**/*\"",
"lint-check": "eslint . --ext .js,.ts && prettier --check --ignore-unknown \"**/*\"",
"prepare": "husky install"
"prepare": "husky install",
"prepublishOnly": "npm run build && npm run compile"
},
"lint-staged": {
"**/*": [
Expand Down
4 changes: 4 additions & 0 deletions templates/demo-contract/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// The things that are being exported here will be able
// to be imported in another package.

export { PROJECT_NAME } from './contracts/PROJECT_NAME'
8 changes: 7 additions & 1 deletion templates/demo-lib/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ tests/
.mocharc-testnet.json
*.md
.prettierrc
.prettierignore
.prettierignore

deploy.ts
tsconfig-scryptTS.json
artifacts/**/*.scrypt
artifacts/**/*.scrypt.map
artifacts/**/*.transformer.json

0 comments on commit cdae17d

Please sign in to comment.