Skip to content

Commit

Permalink
upgrade build system, clean up folder struct
Browse files Browse the repository at this point in the history
  • Loading branch information
arxii committed Mar 22, 2018
1 parent 7f76e69 commit b1ee1b1
Show file tree
Hide file tree
Showing 27 changed files with 84 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
site/* binary
dist/**.* binary
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
* implement prepend
<p align="center"><a href="http://arxii.github.io/preact-grid" alt="logo"><img src="/assets/logo.png" /></a></p>
# Pre Alpha
* implement stickies
* comment and clean code
* cover all code in tests
* tests
* readme
* site with docs
* site with docs / examples
File renamed without changes.
File renamed without changes
File renamed without changes
2 changes: 2 additions & 0 deletions dist/lib.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/lib.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions site/main.js → dist/site.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion site/main.js.map → dist/site.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/test.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/test.js.map

Large diffs are not rendered by default.

33 changes: 19 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
<!-- <head>
<title>💠 Preact Tile Grid</title>
<meta charset="utf-8">
<meta content='width=device-width, initial-scale=1.0' name='viewport' />
<meta content="Preact-Grid" property="og:site_name">
<meta content="arxii/preact-grid" property="og:title">
<meta content="https://github.com/arxii/preact-grid" property="og:url">
<meta content="💠 Preact Tile Grid" property="og:description">
<link rel="icon" type="image/x-icon" class="js-site-favicon" href="./assets/favicon.ico">
<script async src="./dist/site.js"></script>
</head>
<body>
</body>
-->

<head>
<title>Preact Infinity Grid 💠</title>
<title>Grid Test 💠</title>
<meta charset="utf-8">
<link async rel="stylesheet" href="./site/normalize.css">
<meta content='width=device-width, initial-scale=1.0' name='viewport' />
<meta name="viewport" content="width=device-width">
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="Preact Slide">
<meta property="fb:app_id" content="1401488693436528">
<meta content="https://avatars2.githubusercontent.com/u/3401121?s=400&amp;v=4" property="og:image">
<meta content="Preact-Slide" property="og:site_name">
<meta content="arxii/preact-slide" property="og:title">
<meta content="https://github.com/arxii/preact-slide" property="og:url">
<meta content="preact-slide - 📏 Preact Universal Layout Component" property="og:description">
<link rel="icon" type="image/x-icon" class="js-site-favicon" href="./site/favicon.ico">
<link async rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Merienda" rel="stylesheet">
<script async src="./site/main.js"></script>
<meta content="preact-grid" property="og:description">
<script async src="./dist/test.js"></script>
</head>
<body>
</body>

2 changes: 0 additions & 2 deletions index.js

This file was deleted.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "preact-grid",
"version": "0.1.0",
"description": "Preact Infinite Scrolling Tetris Grid",
"version": "0.0.1",
"description": "💠 Preact Infinite Scrolling Tile Grid",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/arxii/preact-grid.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack-dev-server --mode development --progress --config ./test/test.config.js",
"prod": "webpack --mode production --progress --config ./test/test.config.js && webpack --mode production --progress --config ./site.config.js"
"dev": "webpack-dev-server --mode development --progress --config ./scripts/dev.config.js",
"prod": "webpack --mode production --progress --config ./scripts/dev.config.js && webpack --mode production --progress --config ./scripts/lib.config.js"
},
"author": "arxii",
"license": "ISC",
Expand Down
17 changes: 9 additions & 8 deletions test/test.config.js → scripts/dev.config.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
var webpack = require("webpack");
var path = require('path');
// const MinifyPlugin = require("babel-minify-webpack-plugin");
console.log(__dirname)
var cfg = {
devtool: 'source-map',
module: {
rules: [
{ test: /\.coffee$/, use: "coffee-loader"},
{ test: /\.glsl$/, use: "glsl-template-loader" },
{ test: /\.(xml|html|txt|md)$/, loader: "raw-loader" },
{ test: /\.(xml|html|txt|md|glsl)$/, loader: "raw-loader" },
{ test: /\.(less)$/, use: ['style-loader','css-loader','less-loader'] },
{ test: /\.(css)$/, use: ['style-loader','css-loader'] },
{ test: /\.(woff|woff2|eot|ttf|svg)$/,loader: 'url-loader?limit=65000' }
]
},
entry: {
test: "./test/test.coffee",
site: path.join(__dirname,'..','/source/site.coffee'),
test: path.join(__dirname,'..','/source/test.coffee')
},
resolve: {
// "modules": [__dirname+"/node_modules"],
},
output: {
path: __dirname,
publicPath: '/',
path: path.join(__dirname,'..','/dist/'),
publicPath: '/dist/',
filename: "[name].js"
},
devServer: {
port: 3005,
publicPath: '/',
contentBase: __dirname
publicPath: '/dist/',
contentBase: path.join(__dirname,'..')
}
}
module.exports = cfg;
25 changes: 25 additions & 0 deletions scripts/lib.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
var webpack = require("webpack");
var path = require('path');
var fs = require('fs');
var cfg = {
devtool: 'source-map',
module: {
rules: [
{ test: /\.coffee$/, use: "coffee-loader"},
{ test: /\.(xml|html|txt|md)$/, loader: "raw-loader" },
{ test: /\.(less)$/, use: ['style-loader','css-loader','less-loader'] },
{ test: /\.(css)$/, use: ['style-loader','css-loader'] },
{ test: /\.(woff|woff2|eot|ttf|svg)$/,loader: 'url-loader?limit=65000' }
]
},
entry: {
lib: "./source/lib.coffee",
},
output: {
path: path.join(__dirname,"..","/dist/"),
filename: "lib.js",
library: 'PreactGrid',
libraryTarget: 'umd'
}
}
module.exports = cfg;
29 changes: 0 additions & 29 deletions site.config.js

This file was deleted.

2 changes: 2 additions & 0 deletions source/lib.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module.exports.Grid = require './Grid.coffee'
module.exports.GridItem = require './GridItem.coffee'
File renamed without changes.
File renamed without changes.
File renamed without changes
2 changes: 1 addition & 1 deletion test/test.coffee → source/test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require './test.less'
Slide = require 'preact-slide'
{MinMaxScrollEvent} = require 'preact-scroll-events'
{Grid,GridItem} = require '../index'
{Grid,GridItem} = require './lib.coffee'
LoadIcon = require '../source/SquareLoaderIcon.coffee'
DIM = 80
window.log = console.log.bind(console)
Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<head>
<title>Grid Test 💠</title>
<meta charset="utf-8">
<meta content='width=device-width, initial-scale=1.0' name='viewport' />
<meta name="viewport" content="width=device-width">
<meta content="preact-grid" property="og:description">
<script async src="./dist/test.js"></script>
</head>
<body>
</body>
20 changes: 0 additions & 20 deletions test/index.html

This file was deleted.

2 changes: 0 additions & 2 deletions test/test.js

This file was deleted.

1 change: 0 additions & 1 deletion test/test.js.map

This file was deleted.

0 comments on commit b1ee1b1

Please sign in to comment.