Skip to content

Commit

Permalink
restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
beratdaglar committed Apr 6, 2016
0 parents commit 0133da1
Show file tree
Hide file tree
Showing 46 changed files with 6,870 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
26 changes: 26 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
engines:
csslint:
enabled: false
duplication:
enabled: true
config:
languages:
- javascript
eslint:
enabled: true
fixme:
enabled: true
ratings:
paths:
- "**.inc"
- "**.js"
- "**.jsx"
- "**.module"
exclude_paths:
- dist/
- tmp/
- bower_components/
- node_modules/
- tests/
- vendor/
2 changes: 2 additions & 0 deletions .csslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--exclude-exts=.min.css
--ignore=adjoining-classes,box-model,ids,order-alphabetical,unqualified-attributes
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/*{.,-}min.js
52 changes: 52 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
// I want to use babel-eslint for parsing!
"parser": "babel-eslint",
"env": {
// I write for browser
"browser": true,
// in CommonJS
"node": true
},
"plugins": [
"react"
],
"ecmaFeatures": {
"jsx": true
},
// To give you an idea how to override rule options:
"rules": {
"quotes": [2, "single"],
"eol-last": [0],
"no-mixed-requires": [0],
"no-underscore-dangle": [0],
"react/display-name": 1,
"react/forbid-prop-types": 1,
"react/jsx-boolean-value": 1,
"react/jsx-closing-bracket-location": 1,
"react/jsx-curly-spacing": 1,
"react/jsx-indent-props": 1,
"react/jsx-max-props-per-line": 1,
"react/jsx-no-bind": 0,
"react/jsx-no-duplicate-props": 1,
"react/jsx-no-literals": 1,
"react/jsx-no-undef": 1,
"react/jsx-sort-prop-types": 1,
"react/jsx-sort-props": 1,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
"react/no-danger": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-direct-mutation-state": 1,
"react/no-multi-comp": 1,
"react/no-set-state": 1,
"react/no-unknown-property": 1,
"react/prefer-es6-class": 1,
"react/prop-types": 1,
"react/react-in-jsx-scope": 0,
"react/require-extension": 1,
"react/self-closing-comp": 1,
"react/sort-comp": 1,
"react/wrap-multilines": 1
}
}
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules

/bower_components/

/tmp/

dist
28 changes: 28 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules

/bower_components/

/tmp/
68 changes: 68 additions & 0 deletions Brocfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
const env = require('broccoli-env').getEnv();
const concat = require('broccoli-concat'),
mergeTrees = require('broccoli-merge-trees'),
funnel = require('broccoli-funnel'),
uglifyJs = require('broccoli-uglify-sourcemap'),
webpackify = require('broccoli-webpack-cached'),
yuidoc = require('broccoli-yuidoc'),
webpack = require('webpack'),
path = require('path');


var sources = ['src'];
var entries = ['m'];
if ( process.env.TESTING === 'true' ){
sources.push('tests');
entries.push('./tests-bundle');
}
var yuidocNode = new yuidoc(sources, {destDir: 'docs'});
var m = mergeTrees(sources), mNode = mergeTrees(sources);
m = webpackify(m,
{
entry: entries,
output: {filename: '/m.js'},
externals: [{'promise': 'Promise', 'sockjs':'SockJS', 'xr': 'xr', 'slang': 'slang', 'moment': 'moment'}],
devtool: 'cheap-module-inline-source-map',
module: {
preLoaders: [{ test: /\.jsx?$/, loaders: ['source-map-loader'] }],
loaders: [{ test: /\.jsx?$/, loader: 'babel',
query: {
plugins: [ ['babel-plugin-transform-builtin-extend', { globals: ['Error', 'Array'], approximate: true } ] ],
presets: ['es2015', 'react']
}
}]/*,
postLoaders: [{ test: /\.jsx?$/, loader: 'uglify'}]*/
},
resolveLoader: { root: path.join(__dirname,'node_modules') }
});

mNode = webpackify(mNode,{
debug: false,
entry: entries,
output: { libraryTarget: 'commonjs2', filename: '/m.node.js', pathinfo: true },
target: 'node',
externals: [{'promise': 'commonjs lie', 'sockjs':'commonjs sockjs-client', 'xr': 'commonjs xr', 'slang': 'commonjs slang', 'moment': 'commonjs moment' }],
module: { loaders: [{ test: /\.jsx?$/, loader: 'babel', query: { presets: ['es2015','react'] } }] },
resolveLoader: { root: path.join(__dirname,'node_modules') }
});

// concat the css and javascript dependencies
var vendor = mergeTrees(['vendor','bower_components']);
/* v push other dependencies here vendorJS or vendorCSS arrays */
var vendorJS = [];
// data dependencies
vendorJS.push('xr/xr.js');
vendorJS.push('lie/dist/lie.min.js');
vendorJS.push('sockjs-client/dist/sockjs-1.0.3.min.js');
vendorJS.push('slang/slang.min.js');
vendorJS.push('moment/min/moment.min.js');
/* ^ push other dependencies here vendorJS or vendorCSS arrays */

vendor = concat(vendor, { inputFiles : vendorJS, outputFile : 'vendor.js', sourceMapConfig: { enabled: true }});

var mWithDependencies = concat(mergeTrees([vendor, m]), { inputFiles: ['vendor.js','m.js'], outputFile : 'mWithDependencies.js', sourceMapConfig: { enabled: true } });
// minify if production
// widgetFrameworkWithDependencies = uglifyJs(widgetFrameworkWithDependencies);

// and merge all the trees together (uncomment vendorCSS when it is not empty)
module.exports = mergeTrees([m, mWithDependencies, mNode, yuidocNode]);
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
most comprehensive, extensible and awesome javascript model layer ever.
through documentation incoming.
13 changes: 13 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "m.js",
"version": "0.1.0",
"private": true,
"dependencies": {
"lie": "~3.0.0",
"sockjs-client": "~1.0.3",
"xr": "https://github.com/radiosilence/xr.git#d99970bab467fb9881180665364e534a2b10fd19",
"slang": "devongovett/slang",
"underscore": "~1.8.3",
"moment": "^2.11.2"
}
}
Empty file added npmregistry
Empty file.
57 changes: 57 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "m.js",
"version": "0.22.0",
"description": "most awesome javascript model layer.",
"scripts": {
"build": "node ./tasks/build.js dist",
"build:testem": "npm run build -- --testing=true",
"clear": "rm -rf dist",
"start": "broccoli serve",
"test": "testem"
},
"main": "dist/m.node.js",
"devDependencies": {
"babel-core": "^6.5.0",
"babel-eslint": "^5.0.0",
"babel-loader": "^6.2.2",
"babel-preset-es2015": "^6.5.0",
"babel-plugin-transform-builtin-extend": "^1.1.0",
"body-parser": "^1.14.1",
"bower": "^1.2.8",
"broccoli": "^0.16.8",
"broccoli-env": "0.0.1",
"broccoli-funnel": "^1.0.1",
"broccoli-merge-trees": "^1.1.1",
"broccoli-concat": "^2.1.0",
"broccoli-uglify-sourcemap": "^1.1.1",
"broccoli-unwatched-tree": "^0.1.1",
"broccoli-webpack-cached": "^0.1.5",
"broccoli-yuidoc": "^2.1.0",
"chalk": "^1.1.0",
"copy-dereference": "^1.0.0",
"eslint": "^1.9.0",
"eslint-loader": "^1.1.1",
"express": "^4.13.1",
"fs": "0.0.2",
"glob": "^5.0.14",
"http": "0.0.0",
"jasmine": "^2.3.2",
"jasmine-ajax": "3.2.0",
"lazy": "^1.0.11",
"minimist": "^1.1.2",
"morgan": "^1.6.1",
"sockjs": "^0.3.15",
"source-map-loader": "^0.1.5",
"testem": "^0.9.4",
"uglify-loader": "^1.2.0",
"underscore": "^1.8.3"
},
"dependencies": {
"lie": "~3.0.0",
"moment": "^2.12.0",
"slang": "devongovett/slang",
"sockjs-client": "~1.0.3",
"underscore": "~1.8.3",
"xr": "0.1.15"
}
}
Binary file added src/.DS_Store
Binary file not shown.
19 changes: 19 additions & 0 deletions src/core/core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Observable from './observable';
import ObservableArray from './observable-array';
import LocalStorage from './local-storage';
import Utility from './utility';
import SkipList from './skip-list';
import Moment from 'moment';
import Slang from 'slang';

var Core = {
Observable: Observable,
ObservableArray: ObservableArray,
LocalStorage: LocalStorage,
Utility: Utility,
SkipList: SkipList,
moment: Moment,
Slang: Slang
};

export default Core;
Loading

0 comments on commit 0133da1

Please sign in to comment.