Skip to content

Commit 6b0eba8

Browse files
author
Franco Méndez
committed
chore: initialize repository
0 parents  commit 6b0eba8

32 files changed

Lines changed: 10619 additions & 0 deletions

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"react-app"
4+
]
5+
}

.eslintrc.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
parser: "babel-eslint",
3+
settings: {
4+
react: {
5+
version: "detect",
6+
},
7+
},
8+
env: {
9+
es6: true,
10+
jest: true,
11+
node: true,
12+
browser: true,
13+
},
14+
extends: [
15+
"prettier",
16+
"eslint:recommended",
17+
"plugin:react/recommended"
18+
],
19+
plugins: [
20+
"prettier",
21+
"react"
22+
],
23+
rules: {
24+
"prettier/prettier": ["error", {
25+
trailingComma: "es5",
26+
semi: false,
27+
singleQuote: true,
28+
}],
29+
"prefer-const": ["error", {
30+
"destructuring": "any",
31+
"ignoreReadBeforeAssign": false
32+
}],
33+
"no-var": "error",
34+
"eqeqeq": ["error", "smart"],
35+
}
36+
};

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
25+
resources
26+
27+
# Environment file
28+
.env
29+
.env.*

.travis.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
if: tag IS blank
2+
3+
language: node_js
4+
node_js:
5+
- 12.9.1
6+
7+
branches:
8+
only:
9+
# - master
10+
- dev
11+
12+
cache:
13+
npm: true
14+
yarn: true
15+
directories:
16+
- node_modules
17+
18+
before_install:
19+
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.17.3
20+
- source /home/travis/.bashrc
21+
22+
stages:
23+
- name: linter
24+
if: type != push
25+
# - name: deploy staging
26+
# if: branch = dev && type == push
27+
# - name: deploy production
28+
# if: branch = master && type == push
29+
30+
jobs:
31+
include:
32+
# Pull request
33+
- stage: linter
34+
install:
35+
- yarn install
36+
script:
37+
- yarn lint
38+
# # Staging
39+
# - stage: deploy staging
40+
# before_deploy:
41+
# - yarn build
42+
# script: skip
43+
# deploy:
44+
# skip_cleanup: true
45+
# provider: s3
46+
# local_dir: build
47+
# access_key_id: $AWS_ACCESS_KEY
48+
# secret_access_key: $AWS_SECRET_KEY
49+
# region: $S3_BUCKET_REGION
50+
# bucket: $S3_STAGING_BUCKET_NAME
51+
# on:
52+
# branch: dev
53+
# # Production
54+
# - stage: deploy production
55+
# before_deploy:
56+
# - yarn build
57+
# script: skip
58+
# deploy:
59+
# skip_cleanup: true
60+
# provider: s3
61+
# local_dir: build
62+
# access_key_id: $AWS_ACCESS_KEY
63+
# secret_access_key: $AWS_SECRET_KEY
64+
# region: $S3_BUCKET_REGION
65+
# bucket: $S3_PRODUCTION_BUCKET_NAME

.versionrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"header": "CHANGELOG",
3+
"types": [
4+
{"type": "feat", "section": "Features"},
5+
{"type": "fix", "section": "Bug Fixes"},
6+
{"type": "test", "section": "Tests"},
7+
{"type": "chore", "section": "Chore"},
8+
{"type": "style", "section": "Style Improvements"},
9+
{"type": "refactor", "section": "Refactor"},
10+
{"type": "docs", "hidden": true},
11+
{"type": "prerelease", "hidden": true},
12+
{"type": "release", "hidden": true},
13+
{"type": "perf", "hidden": true}
14+
],
15+
"releaseCommitMessageFormat": "release: {{currentTag}}"
16+
}

README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!-- [![travisB]][travisL] -->
2+
[![stdVersionB]][stdVersionL]
3+
[![commitsB]][commitsL]
4+
[![prettierB]][prettierL]
5+
6+
# Salgode API
7+
8+
App Web para compartir viajes hecha en [React](https://reactjs.org/).
9+
Mobile se encuentra [aquí](https://github.com/Varuscl/salgode/).
10+
Backend se encuentra [aquí](https://github.com/Varuscl/salgode-api).
11+
12+
13+
Sigue el desarrollo web en [nuestro Trello web](https://trello.com/b/RpaMyHnH/salgode-web).
14+
El desarrollo móvil y backend [aquí](https://trello.com/b/GCTJ1iMU/salgode).
15+
16+
## Indice
17+
18+
- [Scripts](#scripts)
19+
- [Workflow](#workflow)
20+
- [Gitflow](#gitflow)
21+
- [Release](#release)
22+
- [Motores](#motores)
23+
24+
## Scripts
25+
26+
- `yarn dev`
27+
28+
Corre la aplicación en modo desarrollo
29+
30+
- `yarn lint`
31+
32+
Corre el verificador de estilos.
33+
34+
- `yarn lint:fix`
35+
36+
Corrige las fallas de estilos que se pueden corregir automáticamente.
37+
38+
## Workflow
39+
40+
### Development
41+
42+
- Las ramas `feat/*`, `fix/*`, `chore/*`, `hotfix/*` and `docs/*` se ven bien con `dash-case`.
43+
44+
- Usamos **squash and merge** a `dev` usando [conventional commits](https://conventionalcommits.org).
45+
46+
### Release
47+
48+
- Hacemos **merge** de `dev` a `master` localmente.
49+
50+
- Si el _fast-forward_ no es posible, usamos `prerelease: merge branch 'dev'` como _commit message_.
51+
52+
- Luego hacemos el _release_ usando [standard version](https://github.com/conventional-changelog/standard-version#installation) con el comando `yarn release`, que se encarga de generar el CHANGELOG de la versión automáticamente y subir los cambios a GitHub con el tag de la nueva versión.
53+
54+
## Motores
55+
56+
- node ^12.9.1
57+
- yarn ^1.17.3
58+
59+
<!-- BADGES -->
60+
61+
<!-- [travisB]:https://travis-ci.com/
62+
[travisL]:https://travis-ci.com/ -->
63+
64+
[stdVersionB]:https://img.shields.io/badge/release-standard%20version-blue.svg
65+
[stdVersionL]:https://github.com/conventional-changelog/standard-version
66+
67+
[commitsB]:https://img.shields.io/badge/commits-conventional%20-blue.svg
68+
[commitsL]:https://conventionalcommits.org
69+
70+
[prettierB]:https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square
71+
[prettierL]:https://github.com/prettier/prettier

config/env.js

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
'use strict'
2+
3+
const fs = require('fs')
4+
const path = require('path')
5+
const paths = require('./paths')
6+
7+
// Make sure that including paths.js after env.js will read .env variables.
8+
delete require.cache[require.resolve('./paths')]
9+
10+
const NODE_ENV = process.env.NODE_ENV
11+
if (!NODE_ENV) {
12+
throw new Error(
13+
'The NODE_ENV environment variable is required but was not specified.'
14+
)
15+
}
16+
17+
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
18+
const dotenvFiles = [
19+
`${paths.dotenv}.${NODE_ENV}.local`,
20+
`${paths.dotenv}.${NODE_ENV}`,
21+
// Don't include `.env.local` for `test` environment
22+
// since normally you expect tests to produce the same
23+
// results for everyone
24+
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
25+
paths.dotenv,
26+
].filter(Boolean)
27+
28+
// Load environment variables from .env* files. Suppress warnings using silent
29+
// if this file is missing. dotenv will never modify any environment variables
30+
// that have already been set. Variable expansion is supported in .env files.
31+
// https://github.com/motdotla/dotenv
32+
// https://github.com/motdotla/dotenv-expand
33+
dotenvFiles.forEach(dotenvFile => {
34+
if (fs.existsSync(dotenvFile)) {
35+
require('dotenv-expand')(
36+
require('dotenv').config({
37+
path: dotenvFile,
38+
})
39+
)
40+
}
41+
})
42+
43+
// We support resolving modules according to `NODE_PATH`.
44+
// This lets you use absolute paths in imports inside large monorepos:
45+
// https://github.com/facebook/create-react-app/issues/253.
46+
// It works similar to `NODE_PATH` in Node itself:
47+
// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
48+
// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
49+
// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
50+
// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
51+
// We also resolve them to make sure all tools using them work consistently.
52+
const appDirectory = fs.realpathSync(process.cwd())
53+
process.env.NODE_PATH = (process.env.NODE_PATH || '')
54+
.split(path.delimiter)
55+
.filter(folder => folder && !path.isAbsolute(folder))
56+
.map(folder => path.resolve(appDirectory, folder))
57+
.join(path.delimiter)
58+
59+
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
60+
// injected into the application via DefinePlugin in Webpack configuration.
61+
const REACT_APP = /^REACT_APP_/i
62+
63+
function getClientEnvironment(publicUrl) {
64+
const raw = Object.keys(process.env)
65+
.filter(key => REACT_APP.test(key))
66+
.reduce(
67+
(env, key) => {
68+
env[key] = process.env[key]
69+
return env
70+
},
71+
{
72+
// Useful for determining whether we’re running in production mode.
73+
// Most importantly, it switches React into the correct mode.
74+
NODE_ENV: process.env.NODE_ENV || 'development',
75+
// Useful for resolving the correct path to static assets in `public`.
76+
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
77+
// This should only be used as an escape hatch. Normally you would put
78+
// images into the `src` and `import` them in code to get their paths.
79+
PUBLIC_URL: publicUrl,
80+
}
81+
)
82+
// Stringify all values so we can feed into Webpack DefinePlugin
83+
const stringified = {
84+
'process.env': Object.keys(raw).reduce((env, key) => {
85+
env[key] = JSON.stringify(raw[key])
86+
return env
87+
}, {}),
88+
}
89+
90+
return { raw, stringified }
91+
}
92+
93+
module.exports = getClientEnvironment

0 commit comments

Comments
 (0)