Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

simplify npm release process #4479

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e1147dc
move src/library.*.js -> npm/*/src/index.js
derhuerst Feb 7, 2017
76dc277
simplify scripts/build-rpc-json.js
derhuerst Feb 7, 2017
9e298b0
simplify scripts/dryrun-npm.sh & scripts/release.sh
derhuerst Feb 7, 2017
e2f4bff
basic smoke tests for modules
derhuerst Feb 7, 2017
2ee8948
bugfixes :bug:
derhuerst Feb 7, 2017
b62e3d9
run module tests on release
derhuerst Feb 7, 2017
68d5917
cleanup, bugfix :bug:
derhuerst Feb 7, 2017
4c6f20d
modules: jsnext:main field, LICENSE file
derhuerst Feb 7, 2017
d781e0e
fix npm script, use relative paths
derhuerst Feb 8, 2017
ef7081f
fix copy scripts
derhuerst Feb 8, 2017
bb98d5b
fix library entry points
derhuerst Feb 8, 2017
5500e21
dryrun-npm -> prepare-npm-libraries, reuse it in release.sh
derhuerst Feb 8, 2017
ffd960c
copy abi/util/address -> 3rdparty/etherscan/util
derhuerst Feb 8, 2017
de56706
polyfills as peer dependencies
derhuerst Feb 8, 2017
5c63681
add dependencies, update readmes
derhuerst Feb 8, 2017
d648f82
Add `mkdir -p` to make sure the directories exist
ngotchac Feb 8, 2017
4173f1b
Fixed tests // Fixed published package.json
ngotchac Feb 8, 2017
27f041e
Create symlink in Etherscan for DRY-love
ngotchac Feb 9, 2017
82866f1
merge master into jr-simplify-release
derhuerst Feb 9, 2017
0760a85
export correctly under ES5, remove unnecessary deps
derhuerst Feb 9, 2017
5da69d7
parity.js -> parity.npm.js, library.parity.js -> parity.js
derhuerst Feb 13, 2017
4b6657d
etherscan: import address util from api
derhuerst Feb 13, 2017
fb1cdc1
Merge branch 'master' into jr-simplify-release
ngotchac Feb 15, 2017
3574107
copy license file to libs
derhuerst Feb 16, 2017
9a478f0
build jsonrpc without redirect
derhuerst Feb 16, 2017
0465034
move lib tests to test/e2e
derhuerst Feb 16, 2017
a82fdbc
use mocha for lib tests
derhuerst Feb 16, 2017
7642710
merge master into jr-simplify-release
derhuerst Feb 21, 2017
d55d051
npm libs: babel-polyfill -> babel-runtime
derhuerst Feb 21, 2017
5c9a018
npm libs: update docs, ignore LICENSE files
derhuerst Feb 21, 2017
d8e282e
npm libs: babel-runtime as non-peer dependency
derhuerst Feb 21, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions js/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ docs
.happypack
.npmjs
.eslintcache

npm/*/src
npm/*/dist
npm/jsonrpc/index.json
Copy link
Contributor

@jacogr jacogr Feb 16, 2017

Choose a reason for hiding this comment

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

Shouldn't the LICENSE files be here now as well since it is copied into tracked paths after the fact?

674 changes: 674 additions & 0 deletions js/npm/etherscan/LICENSE

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions js/npm/etherscan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@parity/etherscan",
"description": "The Parity Promise-based library for interfacing with Etherscan over HTTP",
"version": "0.0.0",
"main": "library.js",
"main": "dist/index.js",
"jsnext:main": "src/index.js",
"author": "Parity Team <admin@parity.io>",
"maintainers": [
"Jaco Greeff"
Expand All @@ -22,10 +23,9 @@
"Promise"
],
"scripts": {
"test": "node test/smoke.spec.js"
},
"devDependencies": {
"chai": "3.5.0",
"mocha": "3.2.0"
},
"dependencies": {
"node-fetch": "~1.6.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

import 'babel-polyfill/dist/polyfill.js';
// import 'babel-polyfill/dist/polyfill.js';
import es6Promise from 'es6-promise';
es6Promise.polyfill();

Expand Down
21 changes: 21 additions & 0 deletions js/npm/etherscan/test/smoke.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.

// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

const assert = require('assert');

assert.doesNotThrow(() => {
Copy link
Contributor

@jacogr jacogr Feb 9, 2017

Choose a reason for hiding this comment

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

I am really not sure why we are doing it this way around. I would strongly suggest using describe and it blocks to be consistent with the rest of the codebase instead of using clever helpers.

describe('@parity.js/etherscan', () => {
  it('loads the built library', () => {
    expect(() => require('..')).to.not.throw;
  });
});

works as well, is consistent and readable by all.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's just not to introduce dependencies as this a the built-in assert package

Copy link
Contributor

Choose a reason for hiding this comment

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

It is a dev dependency. I'd rather not have things done in disparate ways all across the codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO i'd rather not have mocha just for making sure things don't crash. Will change it anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

(The only issue I see is that the error message is not displayed with assert, which is not the best)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ngotchac Not as nicely, yet but it says "requiring @parity/foo fails".

const etherscan = require('..');
}, Error, 'requiring @parity/etherscan fails');
674 changes: 674 additions & 0 deletions js/npm/jsonrpc/LICENSE

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion js/npm/jsonrpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@parity/jsonrpc",
"description": "JSON and JS interface defintions for RPC",
"version": "0.0.0",
"main": "library.js",
"main": "dist/index.js",
"jsnext:main": "src/index.js",
"author": "Parity Team <admin@parity.io>",
"maintainers": [
"Jaco Greeff"
Expand All @@ -21,6 +22,7 @@
"Parity"
],
"scripts": {
"test": "node test/smoke.spec.js"
},
"devDependencies": {
},
Expand Down
File renamed without changes.
25 changes: 25 additions & 0 deletions js/npm/jsonrpc/test/smoke.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.

// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

const assert = require('assert');

assert.doesNotThrow(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

As above.

require('..');
}, Error, 'requiring @parity/jsonrpc fails');

assert.doesNotThrow(() => {
require('../index.json');
}, Error, 'requiring @parity/jsonrpc/index.json fails');
Loading