Skip to content

Commit 4d34fa5

Browse files
committed
update to master branch
2 parents 12a5c1d + c38abfb commit 4d34fa5

File tree

17 files changed

+779
-10562
lines changed

17 files changed

+779
-10562
lines changed

β€Ž.circleci/config.ymlβ€Ž

Lines changed: 0 additions & 39 deletions
This file was deleted.

β€Ž.gitignoreβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ website/node_modules
1818

1919
website/i18n/*
2020
!website/i18n/en.json
21+
22+
yarn-error.log

β€Ž.travis.ymlβ€Ž

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: node_js
2+
node_js:
3+
- "8"
4+
- "10"
5+
git:
6+
depth: 5
7+
script:
8+
- yarn build
9+
- yarn test-travis

β€ŽREADME.mdβ€Ž

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# ![ml5](https://user-images.githubusercontent.com/10605821/41332516-2ee26714-6eac-11e8-83e4-a40b8761e764.png)
22

3-
[![CircleCI](https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser.svg?style=flat-square)](https://circleci.com/gh/ITPNYU/ml5) [![Version](https://img.shields.io/npm/v/ml5.svg?style=flat-square)](https://www.npmjs.com/package/ml5)
3+
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=QVNDdlkvMzNYSmhRRWlweXlIOTBENkd0MDBCOUJlbmFVZFRneFIzNlh4az0tLXA4S0loSGNlVUc2V2I3cVdLdXBKdGc9PQ==--8a5e5bfd3eafbba0702c02ec57ffec9d627a78ef)](https://www.browserstack.com/automate/public-build/QVNDdlkvMzNYSmhRRWlweXlIOTBENkd0MDBCOUJlbmFVZFRneFIzNlh4az0tLXA4S0loSGNlVUc2V2I3cVdLdXBKdGc9PQ==--8a5e5bfd3eafbba0702c02ec57ffec9d627a78ef)[![Version](https://img.shields.io/npm/v/ml5.svg?style=flat-square)](https://www.npmjs.com/package/ml5)
44
[![Twitter Follow](https://img.shields.io/twitter/follow/espadrine.svg?style=social&label=Follow)](https://twitter.com/ml5js)
55

66

7-
87
**_This project is currently in development._**
98

109
## Friendly machine learning for the web!
@@ -45,7 +44,7 @@ These examples are meant to serve as an introduction to the library and machine
4544

4645
See [CONTRIBUTING](CONTRIBUTING.md)
4746

48-
47+
Thanks [BrowserStack](https://www.browserstack.com/) for providing testing support.
4948

5049

5150

β€Žkarma.conf.jsβ€Ž

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,71 @@
1-
// Karma configuration
2-
// Generated on Thu Mar 29 2018 11:50:44 GMT-0400 (EDT)
3-
41
module.exports = (config) => {
52
config.set({
6-
// base path that will be used to resolve all patterns (eg. files, exclude)
7-
basePath: '',
8-
// frameworks to use
9-
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
103
frameworks: ['jasmine'],
11-
// list of files / patterns to load in the browser
124
files: [
13-
'src/*/*.test.js',
14-
'src/images/*.jpg',
5+
'src/index.js',
6+
'src/**/*_test.js',
157
],
16-
// list of files / patterns to exclude
17-
exclude: [],
18-
// preprocess matching files before serving them to the browser
19-
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
208
preprocessors: {
21-
// add webpack as preprocessor
22-
'src/*/*.test.js': ['webpack'],
9+
'src/index.js': ['webpack'],
2310
},
2411
webpack: {
25-
// karma watches the test entry points
26-
// (you don't need to specify the entry option)
27-
// webpack watches dependencies
28-
29-
// webpack configuration
30-
12+
// TODO: This is duplication of the webpack.common.babel.js file, but they
13+
// use different import syntaxes so it's not easy to just require it here.
14+
// Maybe this could be put into a JSON file, but the include in the module
15+
// rules is dynamic.
16+
entry: ['babel-polyfill', './src/index.js'],
17+
output: {
18+
libraryTarget: 'umd',
19+
filename: 'ml5.js',
20+
library: 'ml5',
21+
},
22+
module: {
23+
rules: [
24+
{
25+
enforce: 'pre',
26+
test: /\.js$/,
27+
exclude: /node_modules/,
28+
loader: 'eslint-loader',
29+
},
30+
{
31+
test: /\.js$/,
32+
loader: 'babel-loader',
33+
include: require('path').resolve(__dirname, 'src'),
34+
},
35+
],
36+
},
37+
// Don't minify the webpack build for better stack traces
38+
optimization: {
39+
minimize: false,
40+
},
3141
},
3242
webpackMiddleware: {
33-
// webpack-dev-middleware configuration
34-
// i. e.
43+
noInfo: true,
3544
stats: 'errors-only',
3645
},
37-
// test results reporter to use
38-
// possible values: 'dots', 'progress'
39-
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
46+
browserStack: {
47+
username: process.env.BROWSERSTACK_USERNAME,
48+
accessKey: process.env.BROWSERSTACK_ACCESS_KEY
49+
},
50+
captureTimeout: 120000,
51+
reportSlowerThan: 500,
52+
browserNoActivityTimeout: 180000,
53+
customLaunchers: {
54+
bs_chrome_mac: {
55+
base: 'BrowserStack',
56+
browser: 'chrome',
57+
browser_version: 'latest',
58+
os: 'OS X',
59+
os_version: 'High Sierra'
60+
},
61+
},
4062
reporters: ['progress'],
41-
// web server port
4263
port: 9876,
43-
// enable / disable colors in the output (reporters and logs)
4464
colors: true,
45-
// level of logging
46-
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
4765
logLevel: config.LOG_INFO,
48-
// enable / disable watching file and executing tests whenever any file changes
4966
autoWatch: true,
50-
// start these browsers
51-
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
52-
// browsers: ['Chrome', 'Firefox', 'Safari'],
5367
browsers: ['Chrome'],
54-
// Continuous Integration mode
55-
// if true, Karma captures browsers, runs the tests and exits
5668
singleRun: false,
57-
// Concurrency level
58-
// how many browser should be started simultaneous
59-
concurrency: Infinity,
69+
concurrency: Infinity
6070
});
6171
};

β€Žpackage.jsonβ€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ml5",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "A friendly machine learning library for the web.",
55
"main": "dist/ml5.min.js",
66
"directories": {
@@ -12,8 +12,9 @@
1212
"prebuild": "rimraf dist",
1313
"start": "webpack-dev-server --open --config webpack.dev.babel.js",
1414
"build": "webpack --config webpack.prod.babel.js",
15-
"test:dev": "./node_modules/karma/bin/karma start karma.conf.js",
16-
"test": "./node_modules/karma/bin/karma start karma.conf.js --no-auto-watch --single-run"
15+
"test": "./node_modules/karma/bin/karma start karma.conf.js",
16+
"test:single": "./node_modules/karma/bin/karma start karma.conf.js --single-run",
17+
"test-travis": "./scripts/test-travis.sh"
1718
},
1819
"repository": {
1920
"type": "git",
@@ -48,10 +49,9 @@
4849
"html-webpack-plugin": "^3.0.7",
4950
"jasmine-core": "3.1.0",
5051
"karma": "2.0.0",
52+
"karma-browserstack-launcher": "~1.3.0",
5153
"karma-chrome-launcher": "2.2.0",
52-
"karma-firefox-launcher": "1.1.0",
5354
"karma-jasmine": "1.1.1",
54-
"karma-safari-launcher": "1.0.0",
5555
"karma-webpack": "3.0.0",
5656
"npm-run-all": "4.1.2",
5757
"regenerator-runtime": "0.11.1",

β€Žscripts/test-travis.shβ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
if [[ $(node -v) = *v10* ]]; then
4+
karma start \
5+
--browsers='bs_chrome_mac' \
6+
--singleRun --reporters='dots,progress,BrowserStack'
7+
fi
File renamed without changes.

β€Žsrc/ImageClassifier/index.test.jsβ€Ž renamed to β€Žsrc/ImageClassifier/index_test.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint new-cap: 0 */
22

3-
import * as ImageClassifier from './index';
3+
const { ImageClassifier } = ml5;
44

55
const DEFAULTS = {
66
learningRate: 0.0001,
File renamed without changes.

0 commit comments

Comments
Β (0)