Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
suazi committed Jun 3, 2019
0 parents commit dd79e62
Show file tree
Hide file tree
Showing 67 changed files with 11,087 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
import_deps: [:ecto, :phoenix],
inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs}"],
subdirectories: ["priv/*/migrations"]
]
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# JSON junk
*.css.json
*.scss.json
*.sass.json

# The directory Mix will write compiled artifacts to.
/_build/

# If you run "mix test --cover", coverage assets end up here.
/cover/

# The directory Mix downloads your dependencies sources to.
/deps/

# Where 3rd-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez

# Ignore package tarball (built via "mix hex.build").
barcamp-*.tar

# If NPM crashes, it generates a log, let's ignore it too.
npm-debug.log

# The directory NPM downloads your dependencies sources to.
/assets/node_modules/

# Since we are building assets from assets/,
# we ignore priv/static. You may want to comment
# this depending on your deployment strategy.
/priv/static/

# Files matching config/*.secret.exs pattern contain sensitive
# data and you should not commit them into version control.
#
# Alternatively, you may comment the line below and commit the
# secrets files as long as you replace their contents by environment
# variables.
/config/*.secret.exs
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Barcamp

To start your Phoenix server:

* Install dependencies with `mix deps.get`
* Create and migrate your database with `mix ecto.setup`
* Install Node.js dependencies with `cd assets && npm install`
* Start Phoenix endpoint with `mix phx.server`

Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.

Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).

## Learn more

* Official website: http://www.phoenixframework.org/
* Guides: https://hexdocs.pm/phoenix/overview.html
* Docs: https://hexdocs.pm/phoenix
* Mailing list: http://groups.google.com/group/phoenix-talk
* Source: https://github.com/phoenixframework/phoenix
12 changes: 12 additions & 0 deletions assets/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
["@babel/preset-env", {
"useBuiltIns": "entry",
"targets": { "node": "10" }
}]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-throw-expressions"
]
}
4 changes: 4 additions & 0 deletions assets/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
> 0.5%
Last 4 versions
Firefox ESR
not dead
13 changes: 13 additions & 0 deletions assets/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"parser": "babel-eslint",
"extends": [
"eslint:recommended"
],
"settings": {},
"env": {
"browser": "true",
"node": "true"
},
"rules": {},
"globals": {}
}
11 changes: 11 additions & 0 deletions assets/.stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": [
"stylelint-config-rational-order"
],
"rules": {
"plugin/rational-order": [true, {
"border-in-box-model": true,
"empty-line-between-groups": true,
}]
}
}
10 changes: 10 additions & 0 deletions assets/config/paths.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict'

const path = require('path')

module.exports = {
publicPath: '/',
sourcePath: path.resolve(__dirname, '../src'),
outputPath: path.resolve(__dirname, '../../priv/static/js'),
entries: { index: path.resolve(__dirname, '../src/index.js') }
}
137 changes: 137 additions & 0 deletions assets/config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
'use strict'

const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const styleLintPlugin = require('stylelint-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const Fiber = require('fibers')
const paths = require('./paths')

module.exports = (env, options) => ({
optimization: {
// Minify everyting in prod
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: false
}),
new OptimizeCSSAssetsPlugin({})
]
},

resolve: {
// Avoid relative paths when importing bases in modules
alias: {
'~vars': path.resolve(__dirname, '../src/css/_vars.scss'),
'~mixins': path.resolve(__dirname, '../src/css/_mixins.scss')
}
},

entry: paths.entries,

output: {
filename: '[name].js',
path: paths.outputPath,
publicPath: paths.publicPath
},

module: {
rules: [
{ // Support globs in import statements
enforce: 'pre',
test: /\.(js|css|scss|sass)$/,
loader: require.resolve('webpack-import-glob'),
exclude: /node_modules/,
},
{ // JS pipline: Linter => Babel => output
test: /\.js$/,
exclude: [/node_modules/],
use: [
{
loader: require.resolve('babel-loader'),
options: { cacheDirectory: true }
},
{
loader: require.resolve('eslint-loader'),
options: { configFile: path.resolve(__dirname, '../.eslintrc') }
}
]
},
{ // Css modules (+Sass) pipline: transpile Sass => Autoprefixer => Postcss => output
test: /\.(sass|scss|css)$/,
use: [
require.resolve('css-hot-loader'),
MiniCssExtractPlugin.loader,
require.resolve('css-loader'),
{
loader: require.resolve('postcss-loader'),
options: {
ident: 'postcss-modules',
modules: true,
plugins: () => [
require('postcss-modules')({
globalModulePaths: [/index/],
generateScopedName: '[emoji:5]'
}),
require('autoprefixer')
]
}
},
{
loader: require.resolve('sass-loader'),
options: {
implementation: require('sass'),
fiber: Fiber
}
}
]
}
]
},

plugins: [
// Shame on you if you don't know what this does
new MiniCssExtractPlugin({
filename: '../css/index.css'
}),
// Lint and format CSS in 'assets/src'
new styleLintPlugin({
configFile: '.stylelintrc',
context: 'src',
files: '**/*.{css,scss,sass}',
failOnError: true,
quiet: false,
fix: true
}),
// Lint and format CSS in 'lib'
// new styleLintPlugin({
// configFile: '.stylelintrc',
// context: '../lib',
// files: '**/*.{css,scss,sass}',
// failOnError: true,
// quiet: false,
// fix: true
// }),
// Deletes the contents of the destination directory
new CleanWebpackPlugin(
[path.join(paths.outputPath, '../')],
{ verbose: false, allowExternal: true, ignore: ['docs', 'toolkit'] }
),
// Copys files only, doesn't do anything else
new CopyWebpackPlugin(
[{ from: 'static/', to: '../' }],
{ ignore: ['.DS_Store'] }
)
],

// Keep it clean
stats: {
colors: !/^win/i.test(process.platform),
modules: false,
children: false
}
})
54 changes: 54 additions & 0 deletions assets/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"private": true,
"license": "UNLICENSED",
"scripts": {
"deploy": "webpack --config ./config/webpack.config.js --mode production",
"watch": "webpack --config ./config/webpack.config.js --mode development --watch"
},
"dependencies": {
"phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html"
},
"devDependencies": {
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-syntax-throw-expressions": "^7.2.0",
"@babel/preset-env": "^7.1.0",
"autoprefixer": "^8.3.0",
"babel-eslint": "^8.2.3",
"babel-loader": "^8.0.2",
"bootstrap": "^4.1.3",
"browserslist": "^4.0.1",
"clean-webpack-plugin": "^0.1.19",
"copy-webpack-plugin": "^4.5.0",
"css-hot-loader": "^1.4.1",
"css-loader": "^1.0.0",
"eslint": "^4.19.1",
"eslint-loader": "^2.0.0",
"eslint-plugin-babel": "^5.1.0",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.7.0",
"fibers": "^3.1.1",
"jquery": "^3.3.1",
"mini-css-extract-plugin": "^0.4.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"popper.js": "^1.14.4",
"postcss": "^6.0.22",
"postcss-import": "^12.0.1",
"postcss-loader": "^2.1.4",
"postcss-modules": "^1.4.1",
"postcss-normalize": "^7.0.1",
"sass": "^1.19.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"stylelint": "^10.0.1",
"stylelint-config-rational-order": "^0.1.2",
"stylelint-order": "^3.0.0",
"stylelint-webpack-plugin": "^0.10.5",
"uglifyjs-webpack-plugin": "^1.2.4",
"webpack": "4.4.1",
"webpack-cli": "^3.1.1",
"webpack-import-glob": "^2.0.0"
}
}
15 changes: 15 additions & 0 deletions assets/src/css/_mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@mixin breakpoint($point) {
@if $point == mobile {
@media (max-width: 411px) {
@content;
}
} @else if $point == desktop {
@media (min-width: 412px) {
@content;
}
} @else {
@media (min-width: $point) {
@content;
}
}
}
13 changes: 13 additions & 0 deletions assets/src/css/_vars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Layout
$min-width: 992px;
$min-height: 682px;
$padding: 60px;
$padding-mobile: $padding / 3;

// Colors
$purple: #9606cc;
$gray: #504956;
$light-gray: #757575;
$blue: #090b71;
$light-blue: #1e9cfd;
$yellow: #ffec06;
Loading

0 comments on commit dd79e62

Please sign in to comment.