Skip to content
This repository was archived by the owner on Mar 7, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-flow",
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-private-methods",
"@babel/plugin-transform-runtime",
]
}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

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

[*.md]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/dist
/node_modules
/test/coverage
4 changes: 4 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"parser": "babel-eslint",
"extends": ["plugin:prettier/recommended"]
}
5 changes: 5 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[include]
/src

[options]
module.file_ext=.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.api
node_modules
projects
5 changes: 5 additions & 0 deletions .huskyrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hooks": {
"pre-commit": "lint-staged"
}
}
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

{
"**/*.js": ["yarn lint", "git add"]
}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/dist
/node_modules
/test/coverage
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

{
"singleQuote": true,
"trailingComma": "all"
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

{
"eslint.autoFixOnSave": true,
"eslint.enable": true,
"flow.enabled": true,
"flow.runOnEdit": true,
"flow.useNPMPackagedFlow": true,
"javascript.validate.enable": false
}
72 changes: 0 additions & 72 deletions gulpfile.js

This file was deleted.

6 changes: 0 additions & 6 deletions jsconfig.json

This file was deleted.

56 changes: 33 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "fourjs",
"version": "v0.3.0",
"version": "v1.0.0",
"description": "Four is a slightly higher level graphics API based on WebGL 1.0.",
"main": "dist/four.min.js",
"main": "dist/four.js",
"scripts": {
"build": "./node_modules/.bin/gulp build",
"lint": "eslint --fix",
"watch": "./node_modules/.bin/webpack --mode development --hot",
"build": "./node_modules/.bin/webpack --mode production",
"test": "./node_modules/.bin/karma start"
},
"repository": {
Expand All @@ -18,27 +20,35 @@
},
"homepage": "https://github.com/allotrop3/four",
"devDependencies": {
"babel-core": "^6.2.0",
"babel-loader": "^6.2.0",
"babel-plugin-transform-regenerator": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"gulp": "^3.9.0",
"gulp-clean": "^0.3.1",
"gulp-webserver": "^0.9.1",
"highlight.js": "^9.1.0",
"jasmine-core": "^2.3.4",
"karma": "^0.12.0",
"karma-coverage": "^0.5.3",
"karma-firefox-launcher": "^0.1.7",
"karma-qunit": "^0.1.8",
"karma-verbose-reporter": "0.0.3",
"qunitjs": "^1.20.0",
"regenerator": "^0.8.42",
"uglify-loader": "^1.3.0",
"webpack": "^1.12.6",
"webpack-stream": "^2.1.1"
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/plugin-proposal-private-methods": "^7.4.4",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.4.5",
"@babel/preset-flow": "^7.0.0",
"babel-eslint": "11.0.0-beta.0",
"babel-loader": "^8.0.6",
"eslint": "^5.16.0",
"eslint-config-prettier": "^4.3.0",
"eslint-plugin-prettier": "^3.1.0",
"flow-bin": "^0.101.0",
"husky": "^2.4.1",
"jasmine-core": "^3.4.0",
"karma": "^4.1.0",
"karma-coverage": "^1.1.2",
"karma-firefox-launcher": "^1.1.0",
"karma-qunit": "^3.1.2",
"karma-verbose-reporter": "0.0.6",
"lint-staged": "^8.2.0",
"prettier": "^1.18.2",
"qunit": "^2.9.2",
"qunitjs": "^2.4.1",
"webpack": "^4.33.0",
"webpack-cli": "^3.3.4"
},
"dependencies": {
"gl-matrix": "^2.3.1"
"gl-matrix": "^3.0.0",
"lodash": "^4.17.11",
"uuid": "^3.3.2"
}
}
56 changes: 18 additions & 38 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,20 @@
var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
var pkg = JSON.parse(fs.readFileSync('./package.json'));
var uglify = new webpack.optimize.UglifyJsPlugin();
var banner = new webpack.BannerPlugin("Four " + pkg.version + " | Jason Petersen (@allotrop3) | MIT Licensed");
const path = require('path');

var env = {
js: {
context: path.join(__dirname, 'src'),
entry: './four.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'four.js'
},
module: {
loaders: [
{ test: /\.js$/, loader: 'babel', query: { presets: ['es2015'] } }
]
},
resolve: ['', '.js']
},
build: {
context: path.join(__dirname, 'src'),
entry: './four.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'four.min.js'
},
plugins: [uglify, banner],
module: {
loaders: [
{ test: /\.js$/, loader: 'babel', query: { presets: ['es2015'], cacheDirectory: true } }
]
},
resolve: ['', '.js']
}
module.exports = {
entry: path.resolve(__dirname, 'src/four.js'),
output: {
library: 'four',
libraryTarget: 'umd',
path: path.resolve(__dirname, 'dist'),
filename: 'four.js',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: 'babel-loader',
},
],
},
};

module.exports = env;
Loading