diff --git a/README.md b/README.md index d5c345b..cdffae2 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/templates/counter/.npmignore b/templates/counter/.npmignore index 534b5ee..2816dec 100644 --- a/templates/counter/.npmignore +++ b/templates/counter/.npmignore @@ -16,4 +16,11 @@ tests/ .mocharc-testnet.json *.md .prettierrc -.prettierignore \ No newline at end of file +.prettierignore + + +deploy.ts +tsconfig-scryptTS.json +artifacts/**/*.scrypt +artifacts/**/*.scrypt.map +artifacts/**/*.transformer.json \ No newline at end of file diff --git a/templates/counter/package.json b/templates/counter/package.json index 3d8acf8..7ca8d40 100644 --- a/templates/counter/package.json +++ b/templates/counter/package.json @@ -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", @@ -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": { "**/*": [ diff --git a/templates/counter/src/index.ts b/templates/counter/src/index.ts new file mode 100644 index 0000000..7a2738b --- /dev/null +++ b/templates/counter/src/index.ts @@ -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' diff --git a/templates/demo-contract/.npmignore b/templates/demo-contract/.npmignore index 534b5ee..d389b07 100644 --- a/templates/demo-contract/.npmignore +++ b/templates/demo-contract/.npmignore @@ -16,4 +16,10 @@ tests/ .mocharc-testnet.json *.md .prettierrc -.prettierignore \ No newline at end of file +.prettierignore + +deploy.ts +tsconfig-scryptTS.json +artifacts/**/*.scrypt +artifacts/**/*.scrypt.map +artifacts/**/*.transformer.json \ No newline at end of file diff --git a/templates/demo-contract/package.json b/templates/demo-contract/package.json index 47acadc..a337146 100644 --- a/templates/demo-contract/package.json +++ b/templates/demo-contract/package.json @@ -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", @@ -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": { "**/*": [ diff --git a/templates/demo-contract/src/index.ts b/templates/demo-contract/src/index.ts new file mode 100644 index 0000000..7a2738b --- /dev/null +++ b/templates/demo-contract/src/index.ts @@ -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' diff --git a/templates/demo-lib/.npmignore b/templates/demo-lib/.npmignore index 534b5ee..d389b07 100644 --- a/templates/demo-lib/.npmignore +++ b/templates/demo-lib/.npmignore @@ -16,4 +16,10 @@ tests/ .mocharc-testnet.json *.md .prettierrc -.prettierignore \ No newline at end of file +.prettierignore + +deploy.ts +tsconfig-scryptTS.json +artifacts/**/*.scrypt +artifacts/**/*.scrypt.map +artifacts/**/*.transformer.json \ No newline at end of file