Skip to content

Commit

Permalink
Merge pull request #3 from wharfkit/getTableRows
Browse files Browse the repository at this point in the history
Get table rows
  • Loading branch information
dafuga authored Jun 30, 2023
2 parents 0341628 + 57861c3 commit c8fd5d6
Show file tree
Hide file tree
Showing 61 changed files with 452,645 additions and 575 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
lib/
build/
test/browser.html*
contracts/
35 changes: 24 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL := /bin/bash
SRC_FILES := $(shell find src -name '*.ts')
TEST_FILES := $(wildcard test/*.ts)
TEST_FILES := $(shell find test/tests -name '*.ts')
BIN := ./node_modules/.bin
MOCHA_OPTS := -u tdd -r ts-node/register -r tsconfig-paths/register --extension ts
NYC_OPTS := --temp-dir build/nyc_output --report-dir build/coverage
Expand All @@ -11,12 +11,16 @@ lib: ${SRC_FILES} package.json tsconfig.json node_modules rollup.config.mjs
.PHONY: test
test: node_modules
@TS_NODE_PROJECT='./test/tsconfig.json' \
${BIN}/mocha ${MOCHA_OPTS} test/*.ts --grep '$(grep)'
${BIN}/mocha ${MOCHA_OPTS} ${TEST_FILES} --no-timeout --grep '$(grep)'

test/watch: node_modules
@TS_NODE_PROJECT='./test/tsconfig.json' \
${BIN}/mocha --watch ${MOCHA_OPTS} ${TEST_FILES} --no-timeout --grep '$(grep)'

build/coverage: ${SRC_FILES} ${TEST_FILES} node_modules
@TS_NODE_PROJECT='./test/tsconfig.json' \
${BIN}/nyc ${NYC_OPTS} --reporter=html \
${BIN}/mocha ${MOCHA_OPTS} -R nyan test/*.ts
${BIN}/mocha ${MOCHA_OPTS} -R nyan ${TEST_FILES}

.PHONY: coverage
coverage: build/coverage
Expand All @@ -26,7 +30,7 @@ coverage: build/coverage
ci-test: node_modules
@TS_NODE_PROJECT='./test/tsconfig.json' \
${BIN}/nyc ${NYC_OPTS} --reporter=text \
${BIN}/mocha ${MOCHA_OPTS} -R list test/*.ts
${BIN}/mocha ${MOCHA_OPTS} -R list ${TEST_FILES}

.PHONY: check
check: node_modules
Expand All @@ -47,35 +51,44 @@ publish: | distclean node_modules
docs: build/docs
@open build/docs/index.html

.PHONY: generate
generate: lib
node -r esm scripts/codegen-cli.js $(contract)

build/docs: $(SRC_FILES) node_modules
@${BIN}/typedoc --out build/docs \
--excludeInternal --excludePrivate --excludeProtected \
--includeVersion --hideGenerator --readme none \
src/index.ts

build/pages: build/docs test/browser.html
build/pages: build/coverage build/docs build/browser.html
@mkdir -p build/pages
@cp -r build/docs/* build/pages/
@cp test/browser.html build/pages/tests.html
@cp -r build/coverage build/pages/coverage
@cp build/browser.html build/pages/tests.html

.PHONY: deploy-pages
deploy-pages: | clean build/pages node_modules
deploy-pages: | clean lib build/pages node_modules
@${BIN}/gh-pages -d build/pages

test/browser.html: $(SRC_FILES) $(TEST_FILES) test/rollup.config.mjs node_modules
build/browser.html: $(SRC_FILES) $(TEST_FILES) test/rollup.config.mjs node_modules
@${BIN}/rollup -c test/rollup.config.mjs

.PHONY: browser-test
browser-test: test/browser.html
@open test/browser.html
browser-test: build/browser.html
@open build/browser.html

node_modules:
yarn install --non-interactive --frozen-lockfile --ignore-scripts

.PHONY: clean
clean:
rm -rf lib/ build/ test/browser.html
rm -rf lib/ build/ build/browser.html

.PHONY: distclean
distclean: clean
rm -rf node_modules/

.PHONY: accounts
accounts: node_modules
${BIN}/ts-node --project test/utils/setup/tsconfig.json test/utils/setup/accounts.ts
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
PACKAGE
=======
# Contract Kit

Greymass TypeScript library template, intended for libraries that work in any JavaScript context (node.js, Browser, React native), `@types/node` are installed only for tests, don't rely on any node.js types or imports inside `src/` (no `buffer`, `crypto` imports etc, they can be filled for browser but will bloat the bundle 100x)

## Installation

The `PACKAGE` package is distributed as a module on [npm](https://www.npmjs.com/package/PACKAGE).
The `contract` package is distributed as a module on [npm](https://www.npmjs.com/package/contract).

```
yarn add PACKAGE
yarn add contract
# or
npm install --save PACKAGE
npm install --save contract
```

## Usage

TODO
To generate the Contract helper for a specific Antelope contract, use the `generate` make target:

```bash
make generate contract=<CONTRACT_NAME_HERE>
```

and your contract helper will be added to `contracts/CONTRACT_NAME.ts`.

```typescript

## Developing

Expand All @@ -26,3 +33,4 @@ Clone the repository and run `make` to checkout all dependencies and build the p
---

Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).
```
Loading

0 comments on commit c8fd5d6

Please sign in to comment.