Skip to content

Commit

Permalink
build: testing build process
Browse files Browse the repository at this point in the history
  • Loading branch information
kirangadhave committed Jan 4, 2020
1 parent 5075c1c commit 741c9e8
Show file tree
Hide file tree
Showing 8 changed files with 214 additions and 45 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100
indent_size = 2

[*.md]
trim_trailing_whitespace = false
20 changes: 20 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"plugins": ["jest"],
"env": {
"browser": true,
"es6": true,
"node": true,
"mocha": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"]
}
}
162 changes: 144 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,149 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
node_modules
coverage
.nyc_output
.DS_Store
*.log
.vscode
.idea
dist
compiled
.awcache
.rpt2_cache
docs

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

.vscode

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settngs.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# dependencies
/node_modules
/.pnp
.pnp.js
# PyBuilder
target/

# testing
/coverage
# Jupyter Notebook
.ipynb_checkpoints

# production
/build
# IPython
profile_default/
ipython_config.py

# misc
# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Project specific files
files/
results/
node_modules/
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

yarn.lock
package-lock.json

12 changes: 12 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.*
**/tsconfig.json
**/webpack.config.js
node_modules
src
.github
.nyc_output
.coverage
.test
PULL_REQUEST_TEMPLATE.md
package-lock.json
bs-config.json
32 changes: 16 additions & 16 deletions rollup.config.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import sourceMaps from 'rollup-plugin-sourcemaps';
import camelCase from 'lodash.camelcase';
import typescript from 'rollup-plugin-typescript2';
import json from 'rollup-plugin-json';
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import sourceMaps from 'rollup-plugin-sourcemaps'
import camelCase from 'lodash.camelcase'
import typescript from 'rollup-plugin-typescript2'
import json from 'rollup-plugin-json'

const pkg = require('./package.json');
const pkg = require('./package.json')

const libraryName = '--libraryname--';
const libraryName = 'index'

export default {
input: `src/${libraryName}.ts`,
input: `src/Upset/${libraryName}.tsx`,
output: [
{
file: pkg.main,
name: camelCase(libraryName),
format: 'umd',
sourcemap: true,
sourcemap: true
},
{file: pkg.module, format: 'es', sourcemap: true},
{ file: pkg.module, format: 'es', sourcemap: true }
],
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
external: [],
watch: {
include: 'src/**',
include: 'src/Upset/**'
},
plugins: [
// Allow json resolution
json(),
// Compile TypeScript files
typescript({useTsconfigDeclarationDir: true}),
typescript({ useTsconfigDeclarationDir: true }),
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
commonjs(),
// Allow node_modules resolution, so you can use 'external' to control
Expand All @@ -38,6 +38,6 @@ export default {
resolve(),

// Resolve source maps to the original source
sourceMaps(),
],
};
sourceMaps()
]
}
12 changes: 6 additions & 6 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import * as serviceWorker from './serviceWorker';
import {Upset} from './Upset';
import React from 'react'
import ReactDOM from 'react-dom'
import * as serviceWorker from './serviceWorker'
import { Upset } from './Upset'

ReactDOM.render(<Upset />, document.getElementById('root'));
ReactDOM.render(<Upset />, document.getElementById('root'))

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
serviceWorker.unregister()
5 changes: 0 additions & 5 deletions src/setupTests.ts

This file was deleted.

3 changes: 3 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["tslint-config-standard", "tslint-config-prettier"]
}

0 comments on commit 741c9e8

Please sign in to comment.