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

Open source repository #176

Closed
15 tasks done
webmaster128 opened this issue Jul 18, 2018 · 18 comments
Closed
15 tasks done

Open source repository #176

webmaster128 opened this issue Jul 18, 2018 · 18 comments

Comments

@webmaster128
Copy link
Contributor

webmaster128 commented Jul 18, 2018

  • Reach 1000 commit goal 🎉
  • Review dependencies (Review dependencies #186)
  • Change license to Apache 2
  • Clear commit history to avoid publishing earlier software states as AGPL-3.0?
  • Review licenses of dependencies yarn licenses list
  • Finalize name of the library (see Rename Repo to iov-core #208 )
  • Commit build dirs to source control
  • Set up .npmignore files on all repos
  • Claim @Iov name on npm (or other if taken)
  • Figure out how to publish lerna packages
  • Verify we can import and build code in other repo (eg. iov-wallet)
  • Add README to the repo for devs
  • Add README to each sub-package for npm (with basic explanation of main entry point)
  • (once we are satisfied it works) Set version to 0.1.0 on all packages and tag repo
  • Remove currently uploaded releases https://github.com/iov-one/iov-core/releases for licensing reasons
@ethanfrey
Copy link
Contributor

ethanfrey commented Jul 18, 2018

We also need to publish it to npm, and make it importable by other projects, as part of making it open:

list merged into main description (cheers, simon)

@ethanfrey
Copy link
Contributor

Clear commit history to avoid publishing earlier software states as AGPL-3.0?

Actually, I am happy that all historical pieces are under AGPL-2.0. Basically we are saying, if you want to use the code, use it from the time we updated license to Apache and open sourced it.

@ethanfrey
Copy link
Contributor

Useful links:

Lerna publish: https://www.npmjs.com/package/lerna#fixedlocked-mode-default
Typescript + npm: https://ljn.io/posts/publishing-typescript-projects-with-npm/ (add more)
How npm decides which files to publish: https://docs.npmjs.com/files/package.json#files

@webmaster128
Copy link
Contributor Author

Ah great, we don't need to add the compilation results to git

One minor annoyance from this is that the dist files are now inside your package, and potentially inside your git repository. Best practice typically says that build artifacts shouldn’t be placed inside the git repository. The problem is that if you add the ./dist/ folder to your .gitignore file npm will also ignore it!
The solution is to add a separate .npmignore file. In your .gitignore you add the ./dist/ folder so it is not picked up in git and in the .npmignore you add the directory with the .ts files so they are not included in the package.

from https://ljn.io/posts/publishing-typescript-projects-with-npm/

I merge @ethanfrey's todo into the main description

@ethanfrey
Copy link
Contributor

Okay, then we need to add the build stage to prepublish to assure we always push it, not forget like dasync

@ethanfrey
Copy link
Contributor

I sent yarn licenses list to @BenSim to hand to the lawyers. Seem like everything is quite permissive, except our own repo. tweetnacl is imported by bcrypt-pbkdf dependency and is unlicensed, but I see no issue there, as it was publically released as tweets

@webmaster128
Copy link
Contributor Author

@ethanfrey the Unlicense != unlicensed. See the Unlicense here: https://github.com/dchest/tweetnacl-js/blob/master/LICENSE and http://unlicense.org/

@ethanfrey
Copy link
Contributor

Nice.
Also, we get ownership of iov npm account from isabella now :)

@webmaster128
Copy link
Contributor Author

To get started using web4 in pure JavaScript, we do not require the npm upload. See https://gist.github.com/webmaster128/c364e98a0dcf98a6ee22e1e7a8a041e5

@webmaster128
Copy link
Contributor Author

While testing Lerna publishing, I found that Lerna monorepos are made to use the same version for all sub-packages. Thus we're moving readonly-date and type-tagger out of this and give them a 1.0.0. https://www.npmjs.com/org/iov

@ethanfrey
Copy link
Contributor

ethanfrey commented Aug 6, 2018

I will work on the README's a bit in resolving #221

Once that is finished, we just need upstream changes referenced in https://github.com/iov-one/bcp-demo/issues/33 and clean up releases before open sourcing

Oh, and probably auto-build docs in CI and publish somewhere. (#233)

@webmaster128
Copy link
Contributor Author

webmaster128 commented Aug 8, 2018

I'm on the READMEs for sub-packages now, expecting a release after the PR is in

@webmaster128
Copy link
Contributor Author

Repo is open source now. NPM release is waiting for #244

@webmaster128
Copy link
Contributor Author

Lerna takes care of all the tagging for us. 0.2.0 would be the next version and the first to be published on npm

@webmaster128
Copy link
Contributor Author

We got a pre-release version of 0.2.0 on npm: https://www.npmjs.com/package/@iov/core

All out packages are there now. I tested @iov/cli which does not work for several reasons (i.e. don#t waste time tying it). Maybe someone can try @iov/core or the most simple case @iov/encoding.

Releasing works as described here: https://github.com/iov-one/iov-core/wiki/Publishing#how-to-publish-to-npm

@ethanfrey
Copy link
Contributor

I tried the following....

On a new directory, yarn init , yarn add @iov/core

Then added index.js:

const { Bip39, Random } = require('@iov/crypto');
const { Ed25519SimpleAddressKeyringEntry, UserProfile} = require('@iov/keycontrol');
const { Encoding } = require('@iov/encoding');
const { fromHex, toHex } = Encoding;

const demo = async () => {
    // 16 bytes -> 12 word phrase
    const entropy16 = await Random.getBytes(16);
    const mnemonic12 = Bip39.encode(entropy16).asString();
    console.log(mnemonic12);

    const profile = new UserProfile();
    profile.addEntry(Ed25519SimpleAddressKeyringEntry.fromMnemonic(mnemonic12));

    const sub = profile.entryLabels.updates.subscribe({ next: x => console.log(x) });
    profile.setEntryLabel(0, "12 words");

    const id1a = await profile.createIdentity(0);
    console.log(id1a.pubkey.algo, toHex(id1a.pubkey.data))
}

demo();

node index.js:

like claim lottery common garage taxi sentence minimum salute guess student prison
[ undefined ]
[ '12 words' ]
ed25519 99a5daaff8903c0c29a7a6bbe0cb6cad7957ffee18406d6c1d316be2e691fb09

(of course the actual words are different every time)

@ethanfrey
Copy link
Contributor

What is the issue with @iov/cli?

@ethanfrey
Copy link
Contributor

Looks good to me!

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

No branches or pull requests

2 participants