-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b294e5a
commit 9d10831
Showing
8 changed files
with
4,537 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"extends": "eslint:recommended", | ||
"ecmaFeatures": { | ||
"globalReturn": true, | ||
"jsx": true, | ||
"modules": true | ||
}, | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"globals": { | ||
"document": false, | ||
"escape": false, | ||
"navigator": false, | ||
"unescape": false, | ||
"window": false, | ||
"describe": true, | ||
"before": true, | ||
"it": true, | ||
"expect": true, | ||
"sinon": true | ||
}, | ||
"parser": "babel-eslint", | ||
"plugins": [], | ||
"rules": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.nyc_output | ||
coverage/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# CHANGELOG | ||
|
||
### v0.1.0 | ||
|
||
- Find canton by abbreviation or name | ||
- Return canton name in 5 languages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# js-php-swiss-cantons | ||
|
||
Find a Swiss canton by it's abbreviation or name | ||
|
||
## Getting Started | ||
|
||
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. | ||
|
||
### Prerequisites | ||
|
||
In order to work on this package you should have `npm`, `yarn` and `ava` installed globally. | ||
|
||
```shell | ||
https://github.com/stefanzweifel/js-swiss-cantons.git | ||
``` | ||
|
||
### Installing | ||
|
||
You should install the package with `yarn` or `npm` in your project. | ||
|
||
```shell | ||
yarn add https://github.com/stefanzweifel/js-swiss-cantons.git | ||
``` | ||
|
||
> TBD: How to use the package | ||
End with an example of getting some data out of the system or using it for a little demo | ||
|
||
## Running the tests | ||
|
||
Tests are written with [ava](https://github.com/avajs/ava). | ||
|
||
```shell | ||
npm run test | ||
``` | ||
|
||
### And coding style tests | ||
|
||
[Eslint](http://eslint.org/) is used to lint the Javascript code. The checks are executed while running webpack. So you can run one of the following commands. | ||
|
||
```shell | ||
npm run dev | ||
npm run build | ||
``` | ||
|
||
## Deployment | ||
|
||
> TBD | ||
## Built With | ||
|
||
* [ava](https://github.com/avajs/ava) - Test Framework | ||
* [nyc](https://github.com/istanbuljs/nyc) - Code Coverage | ||
|
||
## Versioning | ||
|
||
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/2media/js-regio-parameters). | ||
|
||
## Authors | ||
|
||
* **Stefan Zweifel** - *Initial work* - [stefanzweifel](https://github.com/stefanzweifel) | ||
|
||
See also the list of [contributors](https://github.com/stefanzweifel/js-swiss-cantons/contributors) who participated in this project. | ||
|
||
## Acknowledgments | ||
|
||
> TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"name": "@stefanzweifel/js-swiss-cantons", | ||
"version": "1.0.0", | ||
"description": "Search for Swiss Canton by abbreviation or name", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"build": "NODE_ENV=production webpack --config webpack.config.js", | ||
"dev": "NODE_ENV=development webpack --config webpack.config.js --progress --colors --watch", | ||
"test": "nyc ava" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/stefanzweifel/js-swiss-cantons.git" | ||
}, | ||
"author": "Stefan Zweifel", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/stefanzweifel/js-swiss-cantons/issues" | ||
}, | ||
"homepage": "https://github.com/stefanzweifel/js-swiss-cantons#readme", | ||
"devDependencies": { | ||
"ava": "^0.19.1", | ||
"babel": "^6.23.0", | ||
"babel-core": "^6.24.1", | ||
"babel-eslint": "^7.2.2", | ||
"babel-loader": "^6.4.1", | ||
"babel-preset-es2015": "^6.24.1", | ||
"eslint": "^3.19.0", | ||
"eslint-loader": "^1.7.1", | ||
"nyc": "^10.2.0", | ||
"webpack": "^2.4.1" | ||
}, | ||
"dependencies": {}, | ||
"ava": { | ||
"files": [ | ||
"test/*.js" | ||
], | ||
"source": [ | ||
"**/*.{js}", | ||
"!lib/**/*" | ||
], | ||
"concurrency": 5, | ||
"failFast": true, | ||
"failWithoutAssertions": false, | ||
"tap": false, | ||
"color": true, | ||
"powerAssert": false, | ||
"require": [ | ||
"babel-register" | ||
], | ||
"babel": "inherit" | ||
}, | ||
"nyc": { | ||
"include": [ | ||
"src/**/*.js" | ||
], | ||
"exclude": [ | ||
"src/data/**.js" | ||
], | ||
"reporter": [ | ||
"lcov", | ||
"text-summary" | ||
], | ||
"report-dir": "./coverage" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
const isProduction = (process.env.NODE_ENV === 'production' || process.argv.includes('-p')); | ||
|
||
module.exports = { | ||
entry: { | ||
'app': './src/index.js' | ||
}, | ||
output: { | ||
path: path.resolve(__dirname, 'lib'), | ||
filename: isProduction ? 'bundle.min.js' : 'bundle.js' | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
enforce: "pre", | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: "eslint-loader", | ||
options: { | ||
fix: true | ||
} | ||
}, | ||
{ | ||
test: /\.js$/, | ||
loader: 'babel-loader', | ||
query: { | ||
presets: [ | ||
'es2015' | ||
], | ||
plugins: [] | ||
}, | ||
include: [ | ||
path.resolve(__dirname, 'src') | ||
] | ||
}, { | ||
test: /\.json$/, | ||
loader: "json-loader" | ||
}] | ||
}, | ||
plugins: isProduction ? [ | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production') | ||
}), | ||
new webpack.optimize.UglifyJsPlugin({ | ||
compress: { | ||
warnings: false | ||
}, | ||
output: { | ||
comments: false | ||
} | ||
}) | ||
] : [ | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production') | ||
}) | ||
], | ||
resolve: { | ||
modules: [ | ||
path.join(process.cwd(), 'src'), | ||
'node_modules' | ||
], | ||
extensions: ['.js', '.json'] | ||
}, | ||
devtool: false | ||
}; |
Oops, something went wrong.