Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat: initial commit
  • Loading branch information
siri404-gh committed Oct 30, 2019
0 parents commit 79d631b
Show file tree
Hide file tree
Showing 115 changed files with 28,227 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .babelrc
@@ -0,0 +1,22 @@
{
"presets": [
"@babel/preset-react",
[
"@babel/preset-env",
{
"targets": {
"chrome": "41",
"ie": "10"
}
}
]
],
"plugins": [
"istanbul",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-dynamic-import",
["@babel/plugin-transform-runtime", {
"regenerator": true
}]
]
}
133 changes: 133 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,133 @@
version: 2
jobs:
stage:
working_directory: ~/repo
docker:
- image: circleci/node:8-browsers
steps:
- checkout
- restore_cache:
keys:
- v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
- v1-deps-{{ .Branch }}
- v1-deps
- run:
name: Install dependencies
command: npm install
- save_cache:
key: v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- node_modules
- ~/.npm
- ~/.cache
- run:
name: Build
command: npm run build:client:prod && npm run build:server:prod
- run:
name: Stage Functions
command: npm run firebase:server:prod
- run:
name: Stage Hosting
command: npm run firebase:client:test

unit_test:
working_directory: ~/repo
docker:
- image: circleci/node:8-browsers
steps:
- checkout
- restore_cache:
keys:
- v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
- v1-deps-{{ .Branch }}
- v1-deps
- run:
name: Install dependencies
command: npm install
- save_cache:
key: v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- node_modules
- ~/.npm
- ~/.cache
- run:
name: Lint
command: npm run lint
- run:
name: Test
command: npm test
- run:
name: Codecov
command: npm run test:codecov
- run:
name: Browserstack
command: npm run test:browserstack

performance:
working_directory: ~/repo
docker:
- image: circleci/node:8-browsers
steps:
- checkout
- restore_cache:
keys:
- v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
- v1-deps-{{ .Branch }}
- v1-deps
- run:
name: Install dependencies
command: npm install
- save_cache:
key: v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- node_modules
- ~/.npm
- ~/.cache
- run:
name: Cypress test
command: npm run test:cypress:run
- run:
name: Puppeteer Coverage
command: npm run test:puppeteer:coverage

activate:
docker:
- image: circleci/node:8-browsers
steps:
- checkout
- restore_cache:
keys:
- v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
- v1-deps-{{ .Branch }}
- v1-deps
- run:
name: Install dependencies
command: npm install
- save_cache:
key: v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- node_modules
- ~/.npm
- ~/.cache
- run:
name: Production Hosting
command: npm run firebase:client:prod

workflows:
version: 2
build_and_activate:
jobs:
- stage
- unit_test
- performance:
requires:
- stage
- unit_test
- activate:
requires:
- stage
- unit_test
- performance
filters:
branches:
only: master
7 changes: 7 additions & 0 deletions .editorconfig
@@ -0,0 +1,7 @@
; Unix-style newlines
[*]
charset = utf-8
end_of_line = LF
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
Empty file added .env/.gitkeep
Empty file.
11 changes: 11 additions & 0 deletions .eslintignore
@@ -0,0 +1,11 @@
_dist
_test
_docs
node_modules
webpack
functions
puppeteer
cypress
templates
out
src/server-dev/index.js
51 changes: 51 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,51 @@
module.exports = {
extends: ["eslint:recommended", "plugin:react/recommended"],
parser: "babel-eslint",
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {
jsx: true,
modules: true
}
},
env: {
browser: true,
node: true,
jasmine: true,
},
globals: {
shallow: true
},
rules: {
'react/prop-types': 0,
'no-multiple-empty-lines': ["error", { "max": 1, "maxEOF": 1 }],
'no-extra-parens': ["error", "all", { "nestedBinaryExpressions": false }],
'block-scoped-var': "error",
'eqeqeq': "error",
'object-curly-spacing': ["error", "always"],
'block-scoped-var': "error",
'no-alert': "error",
'no-else-return': "error",
'no-empty-function': "error",
'no-empty-pattern': "error",
'no-magic-numbers': "error",
'no-multi-spaces': "error",
'global-require': "error",
'handle-callback-err': "error",
'no-mixed-requires': "error",
'array-bracket-spacing': ["error", "always"],
'block-spacing': "error",
'camelcase': "error",
'comma-dangle': ["error", "always-multiline"],
'comma-spacing': ["error", { "before": false, "after": true }],
'implicit-arrow-linebreak': ["error", "beside"],
'indent': ["error", 2],
'jsx-quotes': ["error", "prefer-double"],
'react/jsx-closing-bracket-location': ['error', 'after-props'],
},
settings: {
react: {
version: "16.0",
}
},
};
18 changes: 18 additions & 0 deletions .firebaserc
@@ -0,0 +1,18 @@
{
"projects": {
"default": "jsdrome",
"test": "jsdrome"
},
"targets": {
"jsdrome": {
"hosting": {
"prod": [
"jsdrome"
],
"test": [
"jsdrome-test"
]
}
}
}
}
20 changes: 20 additions & 0 deletions .gitignore
@@ -0,0 +1,20 @@
node_modules
.DS_STORE
_dist
_test
_docs
.firebase
functions/index.js
functions/templates
functions/posts
functions/node_modules
*.log
*.err
cypress/screenshots
cypress/videos
.env/env.sh
output
src/server/index.js
src/server/templates
src/server/posts
content.txt
1 change: 1 addition & 0 deletions commitlint.config.js
@@ -0,0 +1 @@
module.exports = { extends: [ '@commitlint/config-conventional' ] };
3 changes: 3 additions & 0 deletions cypress.json
@@ -0,0 +1,3 @@
{
"projectId": "fwdfxw"
}
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
28 changes: 28 additions & 0 deletions cypress/integration/meta.js
@@ -0,0 +1,28 @@
/* eslint-disable no-magic-numbers */
/* eslint-disable no-undef */
import { STAGE_URL, URL, DESCRIPTION } from '../../src/variables';
import links from '../../src/client/list';

beforeEach(() => {
if (window.navigator && navigator.serviceWorker) {
navigator.serviceWorker.getRegistrations()
.then((registrations) => {
registrations.forEach((registration) => {
registration.unregister();
});
});
}
})

describe('My First Test', function () {
it('Visits the Home page', function () {
const post = links[0].links[0];
cy.visit(STAGE_URL);
cy.title().should('eq', post.title + ' | ' + DESCRIPTION);
cy.get('meta[name="description"]').should("have.attr", "content", post.description);
cy.get('meta[property="og:description"]').should("have.attr", "content", post.ogDescription);
cy.get('meta[property="og:title"]').should("have.attr", "content", post.ogTitle);
cy.get('meta[property="og:url"]').should("have.attr", "content", URL + '/');
cy.get('meta[property="og:image"]').should("have.attr", "content", post.ogImage);
})
});
18 changes: 18 additions & 0 deletions cypress/plugins/index.js
@@ -0,0 +1,18 @@
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

// eslint-disable-next-line no-unused-vars
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
25 changes: 25 additions & 0 deletions cypress/support/commands.js
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This is will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/index.js
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')

0 comments on commit 79d631b

Please sign in to comment.