commit
ff81c21d44
@ -1,10 +1,3 @@ |
||||
{ |
||||
"extends": "standard", |
||||
"plugins": ["jasmine"], |
||||
"env": { |
||||
"jasmine": true |
||||
}, |
||||
"globals": { |
||||
"$": false |
||||
} |
||||
"extends": "standard" |
||||
} |
||||
|
@ -0,0 +1,5 @@ |
||||
{ |
||||
presets: [ |
||||
'env' |
||||
] |
||||
} |
@ -1,120 +0,0 @@ |
||||
exports.config = { |
||||
// See http://brunch.io/#documentation for docs.
|
||||
files: { |
||||
javascripts: { |
||||
entryPoints: { |
||||
'js/app.js': 'js/app.js' |
||||
}, |
||||
|
||||
joinTo: { |
||||
'js/test.js': [/^spec/, /^js/, /^node_modules/] |
||||
} |
||||
|
||||
// To use a separate vendor.js bundle, specify two files path
|
||||
// http://brunch.io/docs/config#-files-
|
||||
// joinTo: {
|
||||
// 'js/app.js': /^js/,
|
||||
// 'js/vendor.js': /^(?!js)/
|
||||
// }
|
||||
//
|
||||
// To change the order of concatenation of files, explicitly mention here
|
||||
// order: {
|
||||
// before: [
|
||||
// 'vendor/js/jquery-2.1.1.js',
|
||||
// 'vendor/js/bootstrap.min.js'
|
||||
// ]
|
||||
// }
|
||||
}, |
||||
stylesheets: { |
||||
joinTo: { |
||||
'css/app.css': 'css/app.scss', |
||||
'css/test.css': 'spec/support/jasmine.scss', |
||||
} |
||||
}, |
||||
templates: { |
||||
joinTo: 'js/app.js' |
||||
} |
||||
}, |
||||
|
||||
conventions: { |
||||
// This option sets where we should place non-css and non-js assets in.
|
||||
// By default, we set this to '/assets/static'. Files in this directory
|
||||
// will be copied to `paths.public`, which is 'priv/static' by default.
|
||||
assets: /^(static)/ |
||||
}, |
||||
|
||||
// Phoenix paths configuration
|
||||
paths: { |
||||
// Dependencies and current project directories to watch
|
||||
watched: ['static', 'css', 'css/**', 'js', 'vendor', 'spec'], |
||||
// Where to compile files to
|
||||
public: '../priv/static' |
||||
}, |
||||
|
||||
// Configure your plugins
|
||||
plugins: { |
||||
babel: { |
||||
presets: ['env', 'react'], |
||||
|
||||
// Do not use ES6 compiler in vendor code
|
||||
ignore: [/vendor/] |
||||
}, |
||||
|
||||
copycat: { |
||||
'fonts': ['node_modules/font-awesome/fonts'] |
||||
}, |
||||
|
||||
sass: { |
||||
mode: 'native', |
||||
precision: 8, |
||||
allowCache: true, |
||||
options: { |
||||
includePaths: [ |
||||
'node_modules/bootstrap/scss', |
||||
'node_modules/font-awesome/scss', |
||||
'node_modules/jasmine-core/lib' |
||||
] |
||||
} |
||||
}, |
||||
|
||||
postcss: { |
||||
processors: [ |
||||
require('autoprefixer')(['last 4 versions']), |
||||
require('csswring')() |
||||
] |
||||
} |
||||
}, |
||||
|
||||
modules: { |
||||
autoRequire: { |
||||
'js/app.js': ['js/app'], |
||||
'js/test.js': ['spec/spec_helper'] |
||||
} |
||||
}, |
||||
|
||||
overrides: { |
||||
production: { |
||||
optimize: true, |
||||
sourceMaps: false, |
||||
plugins: { |
||||
autoReload: {enabled: false}, |
||||
}, |
||||
modules: {autoRequire: {'js/app.js': ['js/app']}}, |
||||
paths: {watched: ['static', 'css', 'css/**', 'js', 'vendor']}, |
||||
files: { |
||||
javascripts: {joinTo: 'js/app.js'}, |
||||
stylesheets: {joinTo: 'css/app.css'}, |
||||
} |
||||
} |
||||
}, |
||||
|
||||
npm: { |
||||
enabled: true, |
||||
globals: { |
||||
$: 'jquery', |
||||
jQuery: 'jquery', |
||||
Popper: 'popper.js', |
||||
bootstrap: 'bootstrap' |
||||
} |
||||
} |
||||
} |
@ -1,4 +0,0 @@ |
||||
class BlockSubscription { |
||||
} |
||||
|
||||
export default BlockSubscription |
@ -1,41 +0,0 @@ |
||||
// MIT License
|
||||
|
||||
// Copyright (c) 2017 Geoffrey Lessel
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import React from 'react' |
||||
import ReactDOM from 'react-dom' |
||||
|
||||
export default class ReactPhoenix { |
||||
static init () { |
||||
const elements = document.querySelectorAll('[data-react-class]') |
||||
Array.prototype.forEach.call(elements, e => { |
||||
const targetId = document.getElementById(e.dataset.reactTargetId) |
||||
const targetDiv = targetId || e |
||||
const reactProps = e.dataset.reactProps ? e.dataset.reactProps : '{}' |
||||
const reactElement = React.createElement(global[e.dataset.reactClass], JSON.parse(reactProps)) |
||||
ReactDOM.render(reactElement, targetDiv) |
||||
}) |
||||
} |
||||
} |
||||
|
||||
document.addEventListener('DOMContentLoaded', e => { |
||||
ReactPhoenix.init() |
||||
}) |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,9 @@ |
||||
module.exports = { |
||||
plugins: [ |
||||
require('autoprefixer')({ |
||||
browsers: [ |
||||
'last 4 versions' |
||||
] |
||||
}) |
||||
] |
||||
}; |
@ -1,7 +0,0 @@ |
||||
import BlockSubscription from 'js/lib/block_subscription' |
||||
|
||||
describe('BlockSubscription', function () { |
||||
it('exists', function () { |
||||
expect(BlockSubscription).toBeDefined() |
||||
}) |
||||
}) |
@ -1,8 +0,0 @@ |
||||
import jasmineRequire from 'jasmine-core/lib/jasmine-core/jasmine' |
||||
global.jasmineRequire = jasmineRequire |
||||
require('jasmine-core/lib/jasmine-core/jasmine-html') |
||||
require('jasmine-core/lib/jasmine-core/boot') |
||||
|
||||
window.require.list().forEach(function (module) { |
||||
if (module.indexOf("_spec.js") !== -1) require(module) |
||||
}) |
@ -1 +0,0 @@ |
||||
@import "jasmine-core/jasmine"; |
@ -0,0 +1,56 @@ |
||||
const path = require('path'); |
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin'); |
||||
const CopyWebpackPlugin = require('copy-webpack-plugin'); |
||||
|
||||
module.exports = { |
||||
entry: './js/app.js', |
||||
output: { |
||||
filename: 'app.js', |
||||
path: path.resolve(__dirname, '../priv/static/js') |
||||
}, |
||||
module: { |
||||
rules: [ |
||||
{ |
||||
test: /\.js$/, |
||||
exclude: /node_modules/, |
||||
use: { |
||||
loader: 'babel-loader' |
||||
} |
||||
}, |
||||
{ |
||||
test: /\.scss$/, |
||||
use: ExtractTextPlugin.extract({ |
||||
use: [{ |
||||
loader: "css-loader" |
||||
}, { |
||||
loader: "postcss-loader" |
||||
}, { |
||||
loader: "sass-loader", |
||||
options: { |
||||
precision: 8, |
||||
includePaths: [ |
||||
'node_modules/bootstrap/scss', |
||||
'node_modules/font-awesome/scss' |
||||
] |
||||
} |
||||
}], |
||||
fallback: 'style-loader' |
||||
}) |
||||
}, { |
||||
test: /\.(svg|ttf|eot|woff|woff2)$/, |
||||
use: { |
||||
loader: 'file-loader', |
||||
options: { |
||||
name: '[name].[ext]', |
||||
outputPath: '../fonts/', |
||||
publicPath: '../fonts/' |
||||
} |
||||
} |
||||
} |
||||
] |
||||
}, |
||||
plugins: [ |
||||
new ExtractTextPlugin('../css/app.css'), |
||||
new CopyWebpackPlugin([{ from: 'static/', to: '../' }]) |
||||
] |
||||
}; |
@ -1,11 +0,0 @@ |
||||
defmodule ExplorerWeb.JavascriptTest do |
||||
use ExplorerWeb.FeatureCase, async: true |
||||
|
||||
import Wallaby.Query, only: [css: 1] |
||||
|
||||
test "runs jasmine", %{session: session} do |
||||
session |
||||
|> visit("/jasmine") |
||||
|> assert_has(css(".jasmine-bar.jasmine-passed")) |
||||
end |
||||
end |
Loading…
Reference in new issue