Skip to content

Commit 8817bb5

Browse files
committed
Update example, update webpack and rebuild
1 parent 6e23766 commit 8817bb5

6 files changed

+4837
-4057
lines changed

dist/angular-schema-form-material-bundled.js

+4,095
Large diffs are not rendered by default.

dist/angular-schema-form-material.js

+653-4,012
Large diffs are not rendered by default.

examples/material-example.html renamed to examples/example.html

+1-5
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ <h3>Select Example</h3>
127127
<md-option ng-value="obj" ng-repeat="obj in tests">{{::obj.name}}</md-option>
128128
</md-select>
129129
</md-input-container>
130-
<div class="btw">
131-
By the way, there is also an example of
132-
<a href="custom-validators.html">custom (async) validators</a> example.
133-
</div>
134130
</div>
135131
<h3>Form</h3>
136132
<div ui-ace="{ theme: 'monokai',mode:'json'}"
@@ -168,7 +164,7 @@ <h3>Schema</h3>
168164
<!-- <script type="text/javascript" src="../bower_components/angular-ui-sortable/sortable.js"></script>
169165
-->
170166
<script type="text/javascript" src="../bower_components/angular-ui-ace/ui-ace.js"></script>
171-
<script type="text/javascript" src="../dist/angular-schema-form-material.js"></script>
167+
<script type="text/javascript" src="../dist/angular-schema-form-material-bundled.js"></script>
172168

173169
<script type="text/javascript">
174170
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat

package.json

+15-19
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,40 @@
11
{
22
"name": "angular-schema-form-material",
3-
"version": "1.0.0-alpha.1",
3+
"version": "1.0.0-alpha.2",
44
"description": "Angular Material decorator for Angular Schema Form",
55
"main": "dist/material-decorator.js",
66
"scripts": {
7-
"templates": "gulp templates",
8-
"dist": "npm run build && npm run minify",
97
"build": "webpack",
8+
"dist": "webpack --config webpack.config.dist.js",
109
"watch": "webpack --watch",
11-
"minify": "uglifyjs dist/angular-schema-form-material.js --comments --output=dist/angular-schema-form-material.min.js",
12-
"test": "echo \"Error: no test specified\" && exit 1",
13-
"test-not-yet-done": "karma start --single-run --browsers PhantomJS karma.conf.js --log-level info"
10+
"test": "echo \"Error: test not currently available\" && exit 1",
11+
"test-me": "karma start --log-level debug"
1412
},
1513
"keywords": [
1614
"angular-schema-form-decorator"
1715
],
18-
"author": "Marcel Bennett <[email protected]>",
16+
"author": "json-schema-form",
17+
"contributors": [
18+
"Marcel J Bennett <[email protected]> (https://github.com/Anthropic)"
19+
],
1920
"license": "MIT",
2021
"dependencies": {
2122
"angular": ">= 1.2",
2223
"angular-messages": "^1.5.0",
2324
"angular-sanitize": ">= 1.2",
24-
"angular-schema-form": "git://github.com/json-schema-form/angular-schema-form.git#feature/webpack-babel",
2525
"tv4": "~1.0.15"
2626
},
2727
"devDependencies": {
28+
"babel": "^6.5.2",
2829
"babel-core": "^6.10.4",
2930
"babel-loader": "^6.2.4",
3031
"babel-polyfill": "^6.9.1",
3132
"babel-preset-es2015": "^6.9.0",
3233
"chai": "^3.5.0",
3334
"coveralls": "^2.11.0",
34-
"gulp": "^3.9.0",
35-
"gulp-angular-templatecache": "^1.6.0",
36-
"gulp-concat": "^2.5.2",
37-
"gulp-jscs": "^3.0.2",
38-
"gulp-minify-html": "^1.0.2",
39-
"gulp-rename": "^1.2.2",
40-
"gulp-uglify": "^1.2.0",
41-
"gulp-watch": "^4.2.4",
35+
"html": "^1.0.0",
36+
"html-loader": "^0.4.4",
37+
"html-webpack-plugin": "^2.25.0",
4238
"karma": "^0.13.22",
4339
"karma-chai-sinon": "^0.1.5",
4440
"karma-coverage": "^1.0.0",
@@ -48,13 +44,13 @@
4844
"karma-webpack": "^1.7.0",
4945
"mocha": "^2.5.3",
5046
"mocha-lcov-reporter": "0.0.1",
51-
"ng-cache-loader": "0.0.16",
47+
"ngtemplate-loader": "^1.3.1",
5248
"protractor": "^2.5.1",
5349
"sinon": "^1.17.4",
5450
"sinon-chai": "^2.8.0",
5551
"streamqueue": "^0.1.3",
5652
"uglify-js": "^2.6.2",
57-
"webpack": "^1.13.1",
58-
"webpack-dev-server": "^1.14.1"
53+
"webpack": "^2.1.0-beta.28",
54+
"webpack-dev-server": "^2.1.0-beta.12"
5955
}
6056
}

webpack.config.dist.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const config = require('./webpack.config.js');
2+
const path = require('path');
3+
4+
config.entry = {
5+
'angular-schema-form-material': [ path.join(__dirname, 'src', 'module') ],
6+
'angular-schema-form-material-bundled': [ 'angular-schema-form', path.join(__dirname, 'src', 'module') ],
7+
'angular-schema-form-material.min': [ path.join(__dirname, 'src', 'module') ],
8+
'angular-schema-form-material-bundled.min': [ 'angular-schema-form', path.join(__dirname, 'src', 'module') ],
9+
}
10+
11+
module.exports = config;

webpack.config.js

+62-21
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,79 @@
11
/* global __dirname */
2-
var webpack = require('webpack');
3-
var path = require('path');
4-
var pjson = require('./package.json');
5-
console.log('Angular Schema Form v' + pjson.version);
2+
/**
3+
* NOTE in order to build with angular-schema-form you must
4+
* have it cloned as a sibling directory to this one or npm
5+
* installed with the version you wish to build with.
6+
*/
7+
const webpack = require('webpack');
8+
const path = require('path');
9+
const package = require('./package.json');
10+
const buildDate = new Date();
11+
console.log('Angular Schema Form Material v' + package.version);
12+
const plugins = [
13+
new webpack.BannerPlugin(
14+
'angular-schema-form-material\n' +
15+
'@version ' + package.version + '\n' +
16+
'@date ' + buildDate.toUTCString() + '\n' +
17+
'@link https://github.com/json-schema-form/angular-schema-form-material\n' +
18+
'@license MIT\n' +
19+
'Copyright (c) 2014-' + buildDate.getFullYear() + ' JSON Schema Form'),
20+
/* Minification only occurs if the output is named .min */
21+
new webpack.optimize.UglifyJsPlugin(
22+
{
23+
include: /\.min\.js$/,
24+
minimize: true
25+
})
26+
];
627

728
module.exports = {
8-
entry: './src/module.js',
29+
entry: {
30+
'angular-schema-form-material': [ path.join(__dirname, 'src', 'module') ],
31+
'angular-schema-form-material-bundled': [ 'angular-schema-form', path.join(__dirname, 'src', 'module') ],
32+
},
933
output: {
1034
path: path.join(__dirname, 'dist'),
11-
filename: 'angular-schema-form-material.js',
12-
libraryTarget: 'umd'
35+
filename: '[name].js',
36+
sourceMapFilename: '[name].map'
37+
},
38+
resolve: {
39+
modules: [
40+
path.join(__dirname, "src"),
41+
path.join(__dirname, "src", "material"),
42+
path.join(__dirname, "..", "angular-schema-form", "dist"),
43+
'node_modules',
44+
],
45+
extensions: [ '.js', '.html' ]
1346
},
14-
resolve: { extensions: [ '', '.js', '.html' ] },
1547
module: {
16-
loaders: [
48+
rules: [
1749
{
1850
test: /\.js$/,
19-
include: [ path.join(__dirname, 'src') ],
20-
loader: 'babel',
51+
use: [{
52+
loader: 'babel-loader',
53+
options: {
54+
presets: [
55+
[ "es2015", { "modules": false }]
56+
]
57+
}
58+
}],
59+
exclude: /(node_modules|angular-schema-form)/
2160
},
22-
{ test: /\.html$/, loader: "ng-cache?prefix=decorators/material" }
61+
{
62+
test: /\.html$/,
63+
use: [{
64+
loader: 'ngtemplate-loader',
65+
options: {
66+
relativeTo: path.join(__dirname, 'src')
67+
}
68+
}, 'html-loader'],
69+
exclude: /(index)/
70+
}
2371
]
2472
},
2573
externals: {
2674
'angular': 'var angular',
2775
'tv4': 'var tv4',
76+
'bundle!angular-schema-form': 'commonjs angular-schema-form'
2877
},
29-
plugins: [
30-
new webpack.BannerPlugin(
31-
'angular-schema-form-material\n' +
32-
'@version ' +
33-
pjson.version + '\n' +
34-
'@link https://github.com/json-schema-form/angular-schema-form-material\n' +
35-
'@license MIT\n' +
36-
'Copyright (c) 2016 JSON Schema Form')
37-
]
78+
plugins: plugins
3879
};

0 commit comments

Comments
 (0)