Skip to content
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

WIP: use class format and add all the tests #2

Closed
wants to merge 7 commits into from
Closed

Conversation

dvd-schwrtz
Copy link

No description provided.

src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@dvd-schwrtz dvd-schwrtz changed the title use class format and add all the tests WIP: use class format and add all the tests Aug 6, 2020
@@ -1,30 +1,73 @@
// @ts-ignore
import { getSource, getTarget, getSynths, getUsers, toBytes32 } from 'synthetix/browser';
Copy link
Author

@dvd-schwrtz dvd-schwrtz Aug 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works with the browser example when I import from the browser file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how to get it working for node now

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I keep getting ReferenceError: window is not defined for the builds

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you shouldn't need to specify browser here. Webpack et al will figure out if you are doing a browser based webpack to use the browser field from the synthetix package.json. Likewise if you happen to be doing a node based bundle (which I loathe but necessary if you want to use TypeScript or ES modules), then it will use the main field in the synthetix package.json

@@ -0,0 +1,44 @@
const synthetix = require('../build/index.js')(async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be really nice to be able to run this without requiring a bundler. Perhaps ts-node can do it? But ts-node should only be a devDependency in this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants