Skip to content

Dev #1

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
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"presets": [
[
"@babel/env",
{
"modules": false,
"targets": {
"ie": "11"
}
}
]
],
"plugins": [
"@babel/transform-runtime"
]
}
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*.js,*.json]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
# editorconfig-tools is unable to ignore longs strings or urls
max_line_length = 120
107 changes: 107 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 7
},
"env": {
"node": true,
"browser": true,
"mocha": true,
"es6": true
},
"extends": [
"eslint:recommended"
],
"rules": {
"no-cond-assign": "off",
"space-before-blocks": "error",
"spaced-comment": "error",
"curly": "error",
"guard-for-in": "error",
"no-caller": "error",
"no-else-return": "error",
"no-empty-function": "error",
"no-new-wrappers": "error",
"no-with": "error",
"block-spacing": "error",
"brace-style": [
"error",
"1tbs"
],
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"max-len": [
"error",
120,
{ "ignoreComments": true }
],
"newline-after-var": "error",
"newline-before-return": "error",
"no-multiple-empty-lines": [
"error",
{
"max": 1,
"maxEOF": 1
}
],
"no-nested-ternary": "error",
"no-tabs": "error",
"one-var-declaration-per-line": "error",
"quotes": [
"error",
"single"
],
"max-statements-per-line": [
"error",
{
"max": 1
}
],
"keyword-spacing": [
"error",
{
"after": true
}
],
"key-spacing": [
"error",
{
"afterColon": true
}
],
"object-curly-spacing": ["error", "always"],
"dot-notation": "error",
"no-eval": "error",
"no-multi-spaces": "error",
"yoda": "error",
"camelcase": [
"error",
{
"properties": "never"
}
],
"comma-spacing": [
"error",
{
"after": true
}
],
"consistent-this": [
"error",
"that"
],
"lines-around-directive": [
"error",
"always"
],
"max-nested-callbacks": [
"error",
4
]
}
}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.idea/
.vscode/
.DS_Store
*.lock
!yarn.lock
*.log
out/
dist/
node_modules/
coverage/
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: node_js
node_js:
- "8"
script: "npm test -- --single-run --browsers Firefox"
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
cache: yarn
addons:
firefox: latest
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## LoftSchool example project

### Доступные команды

* `npm install` - установить зависимости
* `npm run prepare` - запустить тесты и проверить стиль кода
* `npm run test` - запустить тесты
* `npm run codestyle` - проверить стиль кода
* `npm run start` - запустить встроенный сервер и следить за изменениями файлов
* `npm run build` - собрать проект в папку `build`
1 change: 1 addition & 0 deletions img/balloon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{{htmlWebpackPlugin.options.title}}</title>
<script type="text/javascript" charset="utf-8"
src="https://api-maps.yandex.ru/2.1/?apikey=0eb99fab-2001-47b8-9c4d-eb4abb8f5daf&lang=ru_RU"></script>
</head>
<body>
<div id="map"></div>
</body>
</html>
1 change: 0 additions & 1 deletion index.html

This file was deleted.

37 changes: 37 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
process.env.CHROME_BIN = require('puppeteer').executablePath()

module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['mocha', 'chai'],
files: [
'test/**/*.js'
],
preprocessors: {
'test/**/*.js': ['webpack', 'sourcemap'],
},
webpack: require('./webpack.config.test'),
webpackMiddleware: {
stats: 'errors-only'
},
reporters: ['mocha', 'coverage-istanbul'],
coverageIstanbulReporter: {
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
port: 9876,
browsers: ['ChromeHeadless'], // или Chrome или Firefox
captureTimeout: 20000,
singleRun: true,
plugins: [
require('karma-mocha'),
require('karma-chai'),
require('karma-webpack'),
require('karma-mocha-reporter'),
require('karma-firefox-launcher'),
require('karma-chrome-launcher'),
require('karma-coverage-istanbul-reporter'),
require('karma-sourcemap-loader')
]
});
};
55 changes: 55 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "yandex-georeview",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"codestyle": "eslint src",
"travis": "npm run codestyle && npm test",
"build": "webpack --progress --colors",
"watch": "webpack-dev-server --progress --colors --open",
"start": "npm run watch",
"test": "karma start",
"cover": "istanbul cover _mocha -- test/*.js",
"prepare": "npm run travis"
},
"author": "",
"license": "MIT",
"dependencies": {
"@babel/core": "^7.1.2",
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@babel/runtime": "^7.1.2",
"@fortawesome/fontawesome-free": "^5.12.1",
"babel-loader": "^8.0.4",
"clean-webpack-plugin": "^0.1.19",
"css-loader": "^1.0.1",
"file-loader": "^2.0.0",
"handlebars": "^4.0.12",
"handlebars-loader": "^1.7.0",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.4.4",
"normalize.css": "^8.0.1",
"style-loader": "^0.23.1",
"webpack": "^4.25.1",
"webpack-dev-server": "^3.1.10"
},
"devDependencies": {
"chai": "^4.2.0",
"eslint": "^5.8.0",
"istanbul": "^0.4.5",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^3.1.1",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage-istanbul-reporter": "^2.0.4",
"karma-firefox-launcher": "^1.1.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^4.0.0-rc.2",
"mocha": "^5.2.0",
"puppeteer": "^1.10.0",
"webpack-cli": "^3.1.2"
}
}
12 changes: 12 additions & 0 deletions src/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{{htmlWebpackPlugin.options.title}}</title>
<script type="text/javascript" charset="utf-8"
src="https://api-maps.yandex.ru/2.1/?apikey=0eb99fab-2001-47b8-9c4d-eb4abb8f5daf&lang=ru_RU"></script>
</head>
<body>
<div id="map"></div>
</body>
</html>
7 changes: 7 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require('@fortawesome/fontawesome-free/css/all.min.css');
import './styles/balloon.css';
import init from './js/georeview';
import '../img/balloon.svg';
// import init from './cluster';

ymaps.ready(init);
Loading