Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "gridion", | ||
"version": "0.0.2", | ||
"description": "", | ||
"main": "index.js", | ||
"version": "0.0.3", | ||
"description": "A small self-adjusting js grid.", | ||
"main": "dist/gridion.js", | ||
"module": "source/lib/gridion.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"build:dev": "webpack --progress --env=dev", | ||
"build:lib": "webpack --progress --env=lib", | ||
"build:demo": "webpack --progress --env=demo", | ||
"build:prod": "webpack --progress --env=prod", | ||
"watch:dev": "webpack-dev-server --env=dev --progress", | ||
"watch:demo": "webpack-dev-server --env=demo --progress" | ||
}, | ||
@@ -20,22 +26,26 @@ "repository": { | ||
"license": "ISC", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"autoprefixer": "^6.6.0", | ||
"autoprefixer-loader": "^3.2.0", | ||
"babel-core": "^6.21.0", | ||
"babel-loader": "^6.2.10", | ||
"babel-preset-es2015": "^6.18.0", | ||
"browser-sync": "^2.18.5", | ||
"browser-sync-webpack-plugin": "^1.1.3", | ||
"css-loader": "^0.26.1", | ||
"extract-text-webpack-plugin": "^1.0.1", | ||
"html-loader": "^0.4.4", | ||
"html-webpack-plugin": "^2.28.0", | ||
"lodash": "^4.17.4", | ||
"style-loader": "^0.13.1", | ||
"babel-core": "^6.25.0", | ||
"babel-eslint": "^7.2.3", | ||
"babel-loader": "^7.1.1", | ||
"babel-preset-env": "^1.6.0", | ||
"clean-webpack-plugin": "^0.1.16", | ||
"css-loader": "^0.28.4", | ||
"eslint": "^4.4.1", | ||
"eslint-loader": "^1.9.0", | ||
"extract-text-webpack-plugin": "^3.0.0", | ||
"html-webpack-harddisk-plugin": "^0.1.0", | ||
"html-webpack-plugin": "^2.30.1", | ||
"postcss-loader": "^2.0.6", | ||
"style-loader": "^0.18.2", | ||
"stylus": "^0.54.5", | ||
"stylus-loader": "^2.4.0", | ||
"url-loader": "^0.5.7", | ||
"webpack": "^1.14.0" | ||
} | ||
"stylus-loader": "^3.0.1", | ||
"webpack": "^3.4.1", | ||
"webpack-dev-server": "^2.6.1", | ||
"webpack-merge": "^4.1.0" | ||
}, | ||
"browserslist": [ | ||
"> 3%" | ||
], | ||
"dependencies": {} | ||
} |
@@ -1,1 +0,79 @@ | ||
#Gridion v0.0.1 | ||
Gridion v0.0.3 | ||
=================== | ||
A small self-adjusting js grid. | ||
Install via npm: | ||
------------------- | ||
```sh | ||
npm i gridion --save | ||
``` | ||
js | ||
```javascript | ||
import Gridion from 'gridion'; | ||
import 'gridion/dist/gridion.css'; | ||
let grid = new Gridion('.container',6); | ||
``` | ||
Or use cdn: | ||
------------------- | ||
```html | ||
<link rel="stylesheet" href="url"> | ||
<script src="url"></script> | ||
``` | ||
```javascript | ||
let grid = new Gridion('.container',6); | ||
``` | ||
Demo: | ||
------------------- | ||
Simple demo | ||
url | ||
Demo1 | ||
url | ||
Demo2 (Infinity gallery) | ||
url | ||
Usage: | ||
------------------- | ||
```javascript | ||
let grid = new Gridion(parentSelector,cols); | ||
``` | ||
```parentSelector``` - tag selector that contains grid; | ||
```cols``` - columns amount; | ||
```javascript | ||
let cellConfig = { | ||
size:{ | ||
w:1,//width | ||
h:2//height | ||
}, | ||
data:'content'//content, | ||
buildCallback:function(){ | ||
//running callback when cell is added to model | ||
} | ||
} | ||
//just an array of cell configurations | ||
let configList = [ | ||
cellConfig1, | ||
cellConfig2, | ||
]; | ||
``` | ||
```grid.addItems(configList,index,cbk)``` - Adds cells to grid | ||
```grid.removeItem(id,cbk)``` - Remove cell from grid | ||
```grid.scaleItem(id,x,y,cbk)``` - Change cell size | ||
```grid.fastAddItem(config,index)``` - Adds cell to grid, without animation | ||
```grid.fastAddItems(configList,index)``` - Adds cells to grid, without animation | ||
```grid.fastRemoveItem(id)``` - Remove cell from grid, without animation |
@@ -1,119 +0,66 @@ | ||
'use strict'; | ||
var webpack = require('webpack'), | ||
ExtractTextPlugin = require('extract-text-webpack-plugin'), | ||
HtmlPlugin = require('html-webpack-plugin'), | ||
path = require('path'), | ||
_ = require('lodash'), | ||
BrowserSyncPlugin = require('browser-sync-webpack-plugin'); | ||
const merge = require('webpack-merge'); | ||
var packageJson = require(__dirname + '/package.json') | ||
const configCommon = require('./webpack/webpack.common'); | ||
var app = { | ||
name:packageJson.name[0].toUpperCase() + packageJson.name.slice(1), | ||
path:path.join(__dirname,'app'), | ||
globalStylePath:path.join(__dirname,'style'), | ||
projectPath:__dirname | ||
let sameRule = function(a,b){ | ||
if(String(a.test)!==String(b.test)){//check test | ||
return false; | ||
} | ||
let use1, use2; | ||
Array.isArray(a.use) ? use1 = a.use : use1 = [a.use]; | ||
Array.isArray(b.use) ? use2 = b.use : use2 = [b.use]; | ||
if(use1.length!==use2.length){//check loaders count | ||
return false; | ||
} | ||
for(let i = 0;i<use1.length;i++){//check by loaders | ||
if(use1[i].loader !== use2[i].loader){ | ||
return false; | ||
} | ||
} | ||
return true; | ||
}; | ||
module.exports = { | ||
entry:{ | ||
['js/'+packageJson.name]:'./app/app.js', | ||
['../demo/index']:'./demo/_index.js', | ||
'css/style.bundle':'./style/style.styl' | ||
}, | ||
output:{ | ||
path:'./bundle/', | ||
filename:'[name].js', | ||
publicPath: '../bundle/' | ||
}, | ||
resolve:{ | ||
alias:{ | ||
_project:app.projectPath, | ||
_app:app.path, | ||
_interfaces:path.join(__dirname,'app','interfaces'), | ||
_models:path.join(__dirname,'app','models'), | ||
_components:path.join(__dirname,'app','components') | ||
} | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.js$/, | ||
include:[ | ||
app.path, | ||
path.join(__dirname,'demo','_index.js') | ||
], | ||
loader:'babel', | ||
query: { | ||
presets: ['es2015'], | ||
//cacheDirectory: true | ||
let configComplete = function (env) { | ||
const config = require(`./webpack/webpack.${env}.js`); | ||
let complete = merge( | ||
{ | ||
customizeArray(a, b, key) { | ||
if(key === 'module.rules'){ | ||
let rules = b; | ||
a.forEach(elA=>{ | ||
if(rules.every(r=>!sameRule(r,elA))){//uniq | ||
rules.push(elA); | ||
} | ||
}); | ||
return rules; | ||
} | ||
if(key === 'plugins'){ | ||
if( | ||
a.find(elA=>elA.constructor.name==='ExtractTextPlugin') && | ||
b.find(elB=>elB.constructor.name==='ExtractTextPlugin') | ||
){ | ||
let etp = a.find(elA=>elA.constructor.name==='ExtractTextPlugin'); | ||
let idx = a.indexOf(etp); | ||
a.splice(idx,1); | ||
} | ||
} | ||
// Fall back to default merging | ||
return undefined; | ||
}, | ||
{ | ||
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!autoprefixer-loader?browsers=last 10 version!stylus-loader'), | ||
test: /\.styl$/, | ||
include:[ | ||
app.path, | ||
app.globalStylePath | ||
] | ||
}, | ||
{ | ||
test: /\.css$/, | ||
loader: ExtractTextPlugin.extract('style-loader', 'css-loader') | ||
}, | ||
{//сжимает файлы в base64 и пихает строкой, при достижении лимита перетаскивает файлы в bundle | ||
test : /\.(ttf|eot|svg|woff|otf|png|jpg|gif)(\?[a-z0-9]+)?$/, | ||
loader : 'url-loader?limit=2000&name=style/assets/[path][name].[ext]' | ||
}, | ||
{ | ||
test: /\.html$/, | ||
loader: "html-loader", | ||
include:[ | ||
app.path | ||
] | ||
customizeObject(a, b, key) { | ||
if (key === 'entry') { | ||
return b; | ||
} | ||
// Fall back to default merging | ||
return undefined; | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
// new webpack.optimize.UglifyJsPlugin({ | ||
// minimize: true, | ||
// warnings: false | ||
// }), | ||
} | ||
)(configCommon,config); | ||
//console.log(complete); | ||
return complete; | ||
}; | ||
new HtmlPlugin({ | ||
title: app.name, | ||
inject: false, | ||
filename: path.join(__dirname, 'demo','index.html'), | ||
template: path.join(__dirname,'templates', 'index.html.ejs') | ||
}), | ||
new HtmlPlugin({ | ||
info:{ | ||
name: packageJson.name, | ||
version: packageJson.version, | ||
description: packageJson.description, | ||
repository:packageJson.repository.url | ||
}, | ||
title: app.name, | ||
inject: false, | ||
filename: path.join(__dirname, 'README.md'), | ||
template: path.join(__dirname,'templates', 'README.md.ejs') | ||
}), | ||
// new HtmlPlugin({ | ||
// info:{ | ||
// name: packageJson.name | ||
// }, | ||
// title: app.name, | ||
// inject: false, | ||
// filename: path.join(__dirname, 'index.js'), | ||
// template: path.join(__dirname, 'templates', 'index.js.ejs') | ||
// }), | ||
new ExtractTextPlugin('[name].css'), | ||
new BrowserSyncPlugin({ | ||
// browse to http://localhost:3000/ during development, | ||
// ./public directory is being served | ||
host: 'localhost', | ||
port: 3000, | ||
server: { baseDir: [__dirname] } | ||
}) | ||
] | ||
}; | ||
module.exports = configComplete; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
130513
49
2
79
18
1551
4
1