Project boilerplate from eunikitin/modern-package-boilerplate

This commit is contained in:
Michael Vines 2018-08-22 13:30:04 -07:00
parent a39df7ee5d
commit 7e109f22c2
18 changed files with 9738 additions and 0 deletions

22
web3.js/.babelrc Normal file
View File

@ -0,0 +1,22 @@
{
"presets": [
[ "env", { "modules": false } ],
"stage-0",
"flow"
],
"env": {
"test": {
"presets": [
"env"
]
}
},
"plugins": [
["module-resolver", {
"root": ["./src"]
}],
"transform-runtime"
]
}

0
web3.js/.eslintignore Normal file
View File

17
web3.js/.eslintrc Normal file
View File

@ -0,0 +1,17 @@
{
"extends": "airbnb",
"parser": "babel-eslint",
"env": {
"mocha": true
},
"rules": {
"linebreak-style": 0,
"import/no-extraneous-dependencies": 0,
"import/no-unresolved": 0,
"import/prefer-default-export": 0,
"import/extensions": 0,
"no-multi-spaces": 0
}
}

16
web3.js/.flowconfig Normal file
View File

@ -0,0 +1,16 @@
[ignore]
<PROJECT_ROOT>/node_modules/*
<PROJECT_ROOT>/lib/.*
<PROJECT_ROOT>/internals/.*
<PROJECT_ROOT>/test/.*
[include]
[options]
module.system.node.resolve_dirname=./src
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
esproposal.export_star_as=enable
esproposal.decorators=ignore
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue

22
web3.js/.gitignore vendored Normal file
View File

@ -0,0 +1,22 @@
# IDE & OS specific
.DS_Store
.idea
# Logs
logs
*.log
# Dependencies
node_modules
# Coverage
coverage
# Types
flow-typed/npm/*
!flow-typed/npm/module_vx.x.x.js
# Release
lib

30
web3.js/.npmignore Normal file
View File

@ -0,0 +1,30 @@
# IDE & OS specific
.DS_Store
.idea
# Logs
logs
*.log
# Dependencies
node_modules
# Coverage
coverage
# Types
flow-typed/*
# Sources, tests and builder files
builder
src
test
internals
.flowconfig
.babelrc
.eslintignore
.eslintrc
.travis.yml
jest.json
renovate.json
rollup.config.js

12
web3.js/.travis.yml Normal file
View File

@ -0,0 +1,12 @@
language: node_js
node_js:
- "lts/*"
- "node"
before_script: npm run lint
script: npm run test
after_success: npm run coveralls
branches:
only:
- master

20
web3.js/LICENSE Normal file
View File

@ -0,0 +1,20 @@
Copyright (c) 2018 Solana Labs, Inc
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

18
web3.js/README.md Normal file
View File

@ -0,0 +1,18 @@
[![Build status](https://api.travis-ci.org/solana-labs/solana-web3.js.svg?branch=master)](https://travis-ci.org/solana-labs/solana-web3.js)
[![Coverage Status](https://coveralls.io/repos/github/solana-labs/solana-web3.js/badge.svg?branch=master)](https://coveralls.io/github/solana-labs/solana-web3.js?branch=master)
# Solana JavaScript API
This is the Solana Javascript API built on the Solana JSON RPC API (**TODO: add
link**).
[API Documentation](TODO!)
# Features
...
# Getting started
...

5
web3.js/jest.json Normal file
View File

@ -0,0 +1,5 @@
{
"collectCoverage": true,
"collectCoverageFrom": ["src/**"],
"coverageReporters": ["json", "lcov", "text-summary", "html"]
}

9425
web3.js/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

64
web3.js/package.json Normal file
View File

@ -0,0 +1,64 @@
{
"name": "@solana/web3.js",
"version": "0.0.1",
"description": "Solana Javascript API",
"keywords": [
"api",
"blockchain"
],
"license": "MIT",
"author": "Solana Labs, Inc",
"homepage": "https://solana.com/",
"repository": {
"type": "git",
"url": "http://github.com/solana-labs/solana-web3.js.git"
},
"bugs": {
"url": "http://github.com/solana-labs/solana-web3.js.git/issues"
},
"main": "lib/index.js",
"scripts": {
"clean": "rimraf ./coverage ./lib",
"dev": "cross-env NODE_ENV=development rollup -c -o lib/index.js",
"build": "cross-env NODE_ENV=production rollup -c -o lib/index.js",
"test": "cross-env NODE_ENV=test jest",
"test:watch": "cross-env NODE_ENV=test jest --watch",
"test:cover": "cross-env NODE_ENV=test jest --coverage",
"coveralls": "npm run test:cover && cat ./coverage/lcov.info | coveralls",
"flow": "flow",
"flow-typed": "npm run clean && flow-typed install --overwrite || true",
"lint": "eslint src",
"prepublish": "npm run clean && npm run test && npm run flow && npm run lint && npm run build"
},
"dependencies": {
"babel-runtime": "^6.26.0"
},
"devDependencies": {
"babel-core": "6.26.0",
"babel-eslint": "8.2.3",
"babel-plugin-module-resolver": "3.1.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "1.6.1",
"babel-preset-flow": "6.23.0",
"babel-preset-stage-0": "6.24.1",
"coveralls": "3.0.0",
"cross-env": "5.1.4",
"enzyme": "3.3.0",
"eslint": "4.19.1",
"eslint-config-airbnb": "16.1.0",
"eslint-plugin-import": "2.11.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "^7.11.1",
"flow-bin": "0.70.0",
"flow-typed": "2.4.0",
"fs-file-tree": "1.0.6",
"jest": "22.4.3",
"rimraf": "2.6.2",
"rollup": "0.58.1",
"rollup-plugin-babel": "3.0.3",
"rollup-plugin-commonjs": "9.1.0",
"rollup-plugin-node-resolve": "3.3.0",
"rollup-plugin-replace": "2.0.0",
"rollup-plugin-uglify": "3.0.0"
}
}

43
web3.js/rollup.config.js Normal file
View File

@ -0,0 +1,43 @@
import nodeResolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import replace from 'rollup-plugin-replace';
import commonjs from 'rollup-plugin-commonjs';
import uglify from 'rollup-plugin-uglify';
const env = process.env.NODE_ENV;
const config = {
input: 'src/index.js',
external: ['react', 'react-dom'],
output: {
format: 'umd',
name: 'npmPackageES6Boilerplate',
},
plugins: [
nodeResolve(),
babel({
exclude: '**/node_modules/**',
runtimeHelpers: true,
}),
replace({
'process.env.NODE_ENV': JSON.stringify(env),
}),
commonjs(),
],
};
if (env === 'production') {
config.plugins.push(
uglify({
compress: {
pure_getters: true,
unsafe: true,
unsafe_comps: true,
warnings: false,
},
}),
);
}
export default config;

View File

@ -0,0 +1,3 @@
// @flow
export default (a: number, b: number): number => (a + b);

View File

@ -0,0 +1,13 @@
export default () => (
'\n' +
' \x1b[42m\x1b[30m \n\x1b[0m' +
' \x1b[42m\x1b[30m Thank you for using this boilerplate! \n\x1b[0m' +
' \x1b[42m\x1b[30m \n\x1b[0m' +
'\n' +
' Getting started\n\n' +
' 1. Clone the repo from github (https://github.com/eunikitin/modern-package-boilerplate.git)\n' +
' 2. Inside the repo directory run npm install && rm -r .git && git init\n' +
' 3. Update package.json with your information' +
'\n'
);

5
web3.js/src/index.js Normal file
View File

@ -0,0 +1,5 @@
import thankYou from 'examples/modern';
export const modern = thankYou;
console.log(thankYou());

View File

@ -0,0 +1,6 @@
import flow from '../../src/examples/flow';
test('1 + 2 = 3', () => {
expect(flow(1, 2)).toBe(3);
});

View File

@ -0,0 +1,17 @@
import modern from '../../src/examples/modern';
const message =
'\n' +
' \x1b[42m\x1b[30m \n\x1b[0m' +
' \x1b[42m\x1b[30m Thank you for using this boilerplate! \n\x1b[0m' +
' \x1b[42m\x1b[30m \n\x1b[0m' +
'\n' +
' Getting started\n\n' +
' 1. Clone the repo from github (https://github.com/eunikitin/modern-package-boilerplate.git)\n' +
' 2. Inside the repo directory run npm install && rm -r .git && git init\n' +
' 3. Update package.json with your information' +
'\n';
test('Message on package usage', () => {
expect(modern()).toBe(message);
});