Samples js shared 2 (#1973)

* Revert "Revert "Share node_modules for samples/js" (#1967)"

This reverts commit 7bb1623e99.

* Add parent directory to the PATH

* Change run-all-js-tests to run samples/js before samples/js/**

* Fix a temporary comment
This commit is contained in:
Erik Arvidsson
2016-07-05 16:25:21 -07:00
committed by GitHub
parent 7bb1623e99
commit 983fa59090
74 changed files with 174 additions and 596 deletions

View File

@@ -10,33 +10,33 @@
"npm": ">=3"
},
"dependencies": {
"babel-regenerator-runtime": "6.5.0",
"babel-runtime": "5.8.38",
"rusha": "0.8.3",
"text-encoding-utf-8": "1.0.1",
"babel-regenerator-runtime": "^6.5.0",
"babel-runtime": "^6.9.2",
"rusha": "^0.8.3",
"text-encoding-utf-8": "^1.0.1",
"tingodb": "^0.4.2"
},
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-cli": "^6.10.1",
"babel-core": "^6.10.4",
"babel-generator": "^6.11.0",
"babel-plugin-syntax-async-functions": "^6.8.0",
"babel-plugin-syntax-flow": "^6.8.0",
"babel-plugin-transform-async-to-generator": "^6.8.0",
"babel-plugin-transform-class-properties": "^6.10.2",
"babel-plugin-transform-es2015-destructuring": "^6.9.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.10.3",
"babel-plugin-transform-es2015-parameters": "^6.9.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"chai": "3.5.0",
"chokidar": "1.4.3",
"commander": "2.9.0",
"flow-bin": "^0.25.0",
"fs-extra": "0.26.7",
"mocha": "2.4.5"
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.11.1",
"chai": "^3.5.0",
"chokidar": "^1.6.0",
"commander": "^2.9.0",
"flow-bin": "0.27.0",
"fs-extra": "^0.30.0",
"mocha": "^2.5.3"
},
"scripts": {
"pretest": "eslint src/ && flow src/",

1
samples/js/.babelrc Symbolic link
View File

@@ -0,0 +1 @@
../../js/.babelrc

View File

@@ -3,6 +3,7 @@
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');
// Allow console
module.exports.rules['no-console'] = 0;
// Used to distinguish between user errors and exceptions.
module.exports.rules['no-throw-literal'] = 0;
module.exports.rules['no-console'] = 0;

1
samples/js/.flowconfig Symbolic link
View File

@@ -0,0 +1 @@
../../js/.flowconfig

1
samples/js/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
node_modules

View File

@@ -1 +0,0 @@
../../../js/.flowconfig

View File

@@ -2,33 +2,10 @@
"name": "noms-aggregate",
"license": "Apache-2.0",
"main": "dist/main.js",
"dependencies": {
"@attic/noms": "^42.0.0",
"babel-regenerator-runtime": "6.5.0",
"yargs": "4.4.0"
},
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"flow-bin": "^0.25.0",
"chai": "3.5.0",
"mocha": "2.4.5"
},
"scripts": {
"start": "babel -d dist -w src",
"build": "BABEL_ENV=production babel -d dist src",
"test": "eslint src/ && flow src/"
"prepublish": "npm run build",
"start": "PATH=../node_modules/.bin/:$PATH babel -d dist -w src",
"build": "PATH=../node_modules/.bin/:$PATH BABEL_ENV=production babel -d dist src",
"test": "PATH=../node_modules/.bin/:$PATH eslint src/ && flow src/"
}
}

View File

@@ -1 +0,0 @@
../../../../js/.babelrc

View File

@@ -1,7 +0,0 @@
// Copyright 2016 The Noms Authors. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');
// Allow console
module.exports.rules['no-console'] = 0;

View File

@@ -59,11 +59,11 @@ async function main(): Promise<void> {
return;
}
const commit = await rv.targetValue(input.store);
const commit = await rv.targetValue(input.database);
let out = Promise.resolve(new Map());
await walk(commit.value, input.store, cv => {
await walk(commit.value, input.database, cv => {
if (!(cv instanceof Struct) || cv.type.name !== args.struct) {
return;
}
@@ -82,7 +82,7 @@ async function main(): Promise<void> {
return true;
});
await outSpec.set().commit(await out);
await outSpec.dataset().commit(await out);
}
function quit(err: string): Function {

View File

@@ -1 +0,0 @@
../../../js/.babelrc

View File

@@ -1,5 +0,0 @@
// Copyright 2016 The Noms Authors. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');

View File

@@ -1 +0,0 @@
../../../js/.flowconfig

View File

@@ -1,31 +1,12 @@
{
"name": "noms-bar-chart",
"license": "Apache-2.0",
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"@attic/noms": "^42.0.0",
"@attic/webpack-config": "^2.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"babel-regenerator-runtime": "6.5.0",
"classnames": "^2.1.3",
"http-server": "^0.8.5",
"react-dom": "^0.14.1",
"react": "^0.14.1"
"dependencies": {
"@attic/webpack-config": "^2.1.0"
},
"scripts": {
"start": "python node_modules/@attic/webpack-config/run.py --src src/main.js --out out.js development",
"build": "python node_modules/@attic/webpack-config/run.py --src src/main.js --out out.js production",
"test": "eslint src/"
"start": "PATH=../node_modules/.bin/:$PATH python node_modules/@attic/webpack-config/run.py --src src/main.js --out out.js development",
"build": "PATH=../node_modules/.bin/:$PATH python node_modules/@attic/webpack-config/run.py --src src/main.js --out out.js production",
"test": "PATH=../node_modules/.bin/:$PATH eslint src/"
}
}

View File

@@ -1 +0,0 @@
../../../js/.flowconfig

View File

@@ -2,34 +2,10 @@
"name": "noms-codec-perf-rig",
"license": "Apache-2.0",
"main": "dist/main.js",
"dependencies": {
"@attic/noms": "file:../../../js/",
"babel-regenerator-runtime": "6.5.0",
"humanize": "0.0.9",
"yargs": "4.4.0"
},
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"flow-bin": "^0.25.0",
"chai": "3.5.0",
"mocha": "2.4.5"
},
"scripts": {
"start": "babel -d dist -w src",
"build": "BABEL_ENV=production babel -d dist src",
"test": "eslint src/ && flow src/"
"prepublish": "npm run build",
"start": "PATH=../node_modules/.bin/:$PATH babel -d dist -w src",
"build": "PATH=../node_modules/.bin/:$PATH BABEL_ENV=production babel -d dist src",
"test": "PATH=../node_modules/.bin/:$PATH eslint src/ && flow src/"
}
}

View File

@@ -1 +0,0 @@
../../../../js/.babelrc

View File

@@ -1,7 +0,0 @@
// Copyright 2016 The Noms Authors. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');
// Allow console
module.exports.rules['no-console'] = 0;

View File

@@ -1 +0,0 @@
../../../js/.flowconfig

View File

@@ -4,34 +4,11 @@
"license": "Apache-2.0",
"main": "dist/main.js",
"version": "1.0.1",
"dependencies": {
"@attic/noms": "file:../../../js/",
"babel-regenerator-runtime": "6.5.0"
},
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"chai": "3.5.0",
"flow-bin": "^0.25.0",
"mocha": "2.4.5",
"yargs": "^4.7.1"
},
"scripts": {
"start": "babel -d dist -w src",
"build": "BABEL_ENV=production babel -d dist src",
"test": "eslint src/ && flow src/"
"prepublish": "npm run build",
"start": "PATH=../node_modules/.bin/:$PATH babel -d dist -w src",
"build": "PATH=../node_modules/.bin/:$PATH BABEL_ENV=production ../node_modules/.bin/babel -d dist src",
"test": "PATH=../node_modules/.bin/:$PATH eslint src/ && flow src/"
},
"keywords": [
"noms",

View File

@@ -1 +0,0 @@
../../../../js/.babelrc

View File

@@ -1,7 +0,0 @@
// Copyright 2016 The Noms Authors. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');
// Allow console
module.exports.rules['no-console'] = 0;

View File

@@ -1 +0,0 @@
../../../js/.babelrc

View File

@@ -1,5 +0,0 @@
// Copyright 2016 The Noms Authors. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');

View File

@@ -1 +0,0 @@
../../../js/.flowconfig

View File

@@ -4,36 +4,11 @@
"license": "Apache-2.0",
"main": "dist/main.js",
"version": "1.0.0",
"dependencies": {
"@attic/noms": "^42.0.0",
"babel-regenerator-runtime": "6.5.0",
"csv": "^1.1.0",
"request": "^2.72.0"
},
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"chai": "3.5.0",
"flow-bin": "^0.25.0",
"mocha": "2.4.5",
"yargs": "^4.7.1"
},
"scripts": {
"start": "babel -d dist -w src",
"build": "BABEL_ENV=production babel -d dist src",
"test": "eslint src/ && flow src/"
"prepublish": "npm run build",
"start": "PATH=../node_modules/.bin/:$PATH babel -d dist -w src",
"build": "PATH=../node_modules/.bin/:$PATH BABEL_ENV=production babel -d dist src",
"test": "PATH=../node_modules/.bin/:$PATH eslint src/ && flow src/"
},
"keywords": [
"csv",

View File

@@ -1 +0,0 @@
../../../js/.flowconfig

View File

@@ -1,36 +1,10 @@
{
"name": "noms-encode-perf-rig",
"main": "dist/main.js",
"dependencies": {
"@attic/noms": "^41.0.0",
"babel-regenerator-runtime": "6.5.0",
"humanize": "0.0.9",
"mz": "2.4.0",
"varint": "4.0.0",
"yargs": "4.4.0"
},
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"flow-bin": "^0.25.0",
"chai": "3.5.0",
"mocha": "2.4.5"
},
"scripts": {
"start": "babel -d dist -w src",
"build": "BABEL_ENV=production babel -d dist src",
"test": "eslint src/ && flow src/"
"prepublish": "npm run build",
"start": "PATH=../node_modules/.bin/:$PATH babel -d dist -w src",
"build": "PATH=../node_modules/.bin/:$PATH BABEL_ENV=production babel -d dist src",
"test": "PATH=../node_modules/.bin/:$PATH eslint src/ && flow src/"
}
}

View File

@@ -1 +0,0 @@
../../../../js/.babelrc

View File

@@ -1,3 +0,0 @@
module.exports = require('@attic/eslintrc');
// Allow console
module.exports.rules['no-console'] = 0;

View File

@@ -1 +0,0 @@
../../../../js/.flowconfig

View File

@@ -3,33 +3,10 @@
"description": "Finds photos in slurped flickr data",
"license": "Apache-2.0",
"main": "dist/main.js",
"dependencies": {
"@attic/noms": "^42.0.0",
"babel-regenerator-runtime": "6.5.0",
"yargs": "4.4.0"
},
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"chai": "3.5.0",
"flow-bin": "^0.23.0",
"mocha": "2.4.5"
},
"scripts": {
"start": "babel -d dist -w src",
"build": "babel -d dist src",
"test": "eslint src/ && flow src/"
"prepublish": "npm run build",
"start": "PATH=../../node_modules/.bin/:$PATH babel -d dist -w src",
"build": "PATH=../../node_modules/.bin/:$PATH babel -d dist src",
"test": "PATH=../../node_modules/.bin/:$PATH eslint src/ && flow src/"
}
}

View File

@@ -1 +0,0 @@
../../../../../js/.babelrc

View File

@@ -77,7 +77,7 @@ async function main(): Promise<void> {
if (isSubtype(placeType, v.type)) {
photo.geoposition = getGeo(v);
}
result = result.then(r => r.insert(newStruct('Photo', photo)));
result = result.then(r => r.add(newStruct('Photo', photo)));
return true;
}
});

View File

@@ -1 +0,0 @@
../../../../js/.flowconfig

View File

@@ -3,34 +3,10 @@
"description": "Imports photo metadata from Facebook",
"license": "Apache-2.0",
"main": "dist/main.js",
"dependencies": {
"@attic/noms": "42.0.0",
"babel-regenerator-runtime": "6.5.0",
"node-fetch": "1.5.2",
"yargs": "4.4.0"
},
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"chai": "3.5.0",
"flow-bin": "^0.23.0",
"mocha": "2.4.5"
},
"scripts": {
"start": "babel -d dist -w src",
"build": "babel -d dist src",
"test": "eslint src/ && flow src/"
"prepublish": "npm run build",
"start": "PATH=../../node_modules/.bin/:$PATH babel -d dist -w src",
"build": "PATH=../../node_modules/.bin/:$PATH babel -d dist src",
"test": "PATH=../../node_modules/.bin/:$PATH eslint src/ && flow src/"
}
}

View File

@@ -1 +0,0 @@
../../../../../js/.babelrc

View File

@@ -1,8 +0,0 @@
// Copyright 2016 The Noms Authors. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');
// Used to distinguish user errors from exceptions.
module.exports.rules['no-throw-literal'] = 0;
module.exports.rules['no-console'] = 0;

View File

@@ -1 +0,0 @@
../../../../js/.flowconfig

View File

@@ -3,35 +3,10 @@
"description": "Creates standard photo structs out of slurped flickr data",
"license": "Apache-2.0",
"main": "dist/main.js",
"dependencies": {
"@attic/noms": "39.2.0",
"babel-regenerator-runtime": "6.5.0",
"humanize": "0.0.9",
"node-fetch": "1.5.2",
"yargs": "4.4.0"
},
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"chai": "3.5.0",
"flow-bin": "^0.23.0",
"mocha": "2.4.5"
},
"scripts": {
"start": "babel -d dist -w src",
"build": "babel -d dist src",
"test": "eslint src/ && flow src/"
"prepublish": "npm run build",
"start": "PATH=../../node_modules/.bin/:$PATH babel -d dist -w src",
"build": "PATH=../../node_modules/.bin/:$PATH babel -d dist src",
"test": "PATH=../../node_modules/.bin/:$PATH eslint src/ && flow src/"
}
}

View File

@@ -1 +0,0 @@
../../../../../js/.babelrc

View File

@@ -1,8 +0,0 @@
// Copyright 2016 The Noms Authors. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');
// Allow console
module.exports.rules['no-console'] = 0;
module.exports.rules['no-throw-literal'] = 0;

View File

@@ -31,8 +31,11 @@ const sizes = ['t', 's', 'm', 'l', 'o'];
const flickrNum = makeUnionType([stringType, numberType]);
const sizeTypes = sizes.map(s =>
makeStructType('', {
// $FlowIssue: computed property keys not supported
['url_' + s]: stringType,
// $FlowIssue: computed property keys not supported
['width_' + s]: flickrNum,
// $FlowIssue: computed property keys not supported
['height_' + s]: flickrNum,
}));
@@ -49,13 +52,19 @@ const sizeTypes = sizes.map(s =>
// } |
// ... for all the image size suffixes ...
// }
const imageType = makeUnionType(sizeTypes.map(st =>
makeStructType('', Object.assign(({
title: stringType,
tags: stringType,
latitude: flickrNum,
longitude: flickrNum,
}:Object), st.desc.fields))));
const imageType = makeUnionType(sizeTypes.map(st => {
const newFields = {
title: stringType,
tags: stringType,
latitude: flickrNum,
longitude: flickrNum,
};
st.desc.forEachField((name, type) => {
newFields[name] = type;
});
return makeStructType('', newFields);
}));
main().catch(ex => {
console.error(ex);
@@ -91,7 +100,7 @@ async function main(): Promise<void> {
photo.geoposition = geo;
}
result = result.then(r => r.insert(newStruct('Photo', photo)));
result = result.then(r => r.add(newStruct('Photo', photo)));
return true;
}
return false;
@@ -111,7 +120,6 @@ function getSizes(input: Object): Map<Struct, string> {
return new Map(
sizes.map((s, i) => {
if (!isSubtype(sizeTypes[i], input.type)) {
// $FlowIssue - Flow doesn't realize that filter will return only non-nulls.
return null;
}
const url = input['url_' + s];

View File

@@ -1 +0,0 @@
../../../../js/.flowconfig

View File

@@ -3,36 +3,10 @@
"description": "Imports album and photo metadata from Flickr",
"license": "Apache-2.0",
"main": "dist/main.js",
"dependencies": {
"@attic/noms": "^42.0.0",
"babel-regenerator-runtime": "6.5.0",
"flickr-oauth-and-upload": "0.8.0",
"humanize": "0.0.9",
"node-fetch": "1.5.2",
"yargs": "4.4.0"
},
"devDependencies": {
"@attic/eslintrc": "^1.0.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"chai": "3.5.0",
"flow-bin": "^0.23.0",
"mocha": "2.4.5"
},
"scripts": {
"start": "babel -d dist -w src",
"build": "babel -d dist src",
"test": "eslint src/ && flow src/"
"prepublish": "npm run build",
"start": "PATH=../../node_modules/.bin/:$PATH babel -d dist -w src",
"build": "PATH=../../node_modules/.bin/:$PATH babel -d dist src",
"test": "PATH=../../node_modules/.bin/:$PATH eslint src/ && flow src/"
}
}

View File

@@ -1 +0,0 @@
../../../../../js/.babelrc

View File

@@ -1,8 +0,0 @@
// Copyright 2016 The Noms Authors. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');
module.exports.rules['arrow-body-style'] = 0;
module.exports.rules['no-console'] = 0;
module.exports.rules['no-throw-literal'] = 0;

View File

@@ -54,7 +54,9 @@ main().catch(ex => {
process.exit(1);
});
var authToken, authSecret, authURL: string; // eslint-disable-line no-var
var authToken: ?string; // eslint-disable-line no-var
var authSecret: ?string; // eslint-disable-line no-var
var authURL: ?string; // eslint-disable-line no-var
var out: Dataset; // eslint-disable-line no-var
async function main(): Promise<void> {
@@ -76,13 +78,11 @@ async function main(): Promise<void> {
const photosetsJSON = await getPhotosetsJSON();
let seen = 0;
const photosets = await Promise.all(photosetsJSON.map(p => {
return getPhotoset(p.id).then(p => {
process.stdout.write(
`${clearLine}${++seen} of ${photosetsJSON.length} photosets imported...`);
return p;
});
})).then(sets => new Set(sets));
const photosets = await Promise.all(photosetsJSON.map(p => getPhotoset(p.id).then(p => {
process.stdout.write(
`${clearLine}${++seen} of ${photosetsJSON.length} photosets imported...`);
return p;
}))).then(sets => new Set(sets));
process.stdout.write(clearLine);
return out.commit(newStruct('', {
@@ -133,6 +133,7 @@ function getAuthToken(): Promise<[string, string]> {
function promptForAuth(url: string): Promise<void> {
return new Promise((res) => {
process.stdout.write(`Go to ${url} to grant permissions to access Flickr...\n`);
// $FlowIssue: Flow does not know about createInterface.
const rl = readline.createInterface({input: process.stdin, output: process.stdout});
rl.question('Press enter when done\n', () => {
process.stdout.write('Authenticated. Next time run:\n' +

View File

@@ -1 +0,0 @@
../../../js/.flowconfig

View File

@@ -2,36 +2,10 @@
"name": "noms-fs",
"license": "Apache-2.0",
"main": "dist/main.js",
"dependencies": {
"@attic/noms": "file:../../../js",
"babel-regenerator-runtime": "6.5.0",
"humanize": "0.0.9",
"mz": "2.4.0",
"oauth": "^0.9.14",
"yargs": "4.4.0"
},
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"flow-bin": "^0.25.0",
"chai": "3.5.0",
"mocha": "2.4.5"
},
"scripts": {
"start": "babel -d dist -w src",
"build": "BABEL_ENV=production babel -d dist src",
"test": "eslint src/ && flow src/"
"prepublish": "npm run build",
"start": "PATH=../node_modules/.bin/:$PATH babel -d dist -w src",
"build": "PATH=../node_modules/.bin/:$PATH BABEL_ENV=production babel -d dist src",
"test": "PATH=../node_modules/.bin/:$PATH eslint src/ && flow src/"
}
}

View File

@@ -1 +0,0 @@
../../../../js/.babelrc

View File

@@ -1,7 +0,0 @@
// Copyright 2016 The Noms Authors. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');
// Allow console
module.exports.rules['no-console'] = 0;

View File

@@ -89,7 +89,7 @@ async function main(): Promise<void> {
}
async function processPath(p: string, store: Database): Promise<null|Directory|File> {
async function processPath(p: string, store: Database): Promise<void|Directory|File> {
numFilesFound++;
const st = await fs.stat(p);
sizeFilesFound += st.size;

View File

@@ -1 +0,0 @@
../../../js/.flowconfig

View File

@@ -2,36 +2,10 @@
"name": "noms-hash-perf-rig",
"license": "Apache-2.0",
"main": "dist/main.js",
"dependencies": {
"@attic/noms": "^42.0.0",
"babel-regenerator-runtime": "6.5.0",
"humanize": "0.0.9",
"mz": "2.4.0",
"oauth": "^0.9.14",
"yargs": "4.4.0"
},
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"flow-bin": "^0.25.0",
"chai": "3.5.0",
"mocha": "2.4.5"
},
"scripts": {
"start": "babel -d dist -w src",
"build": "BABEL_ENV=production babel -d dist src",
"test": "eslint src/ && flow src/"
"prepublish": "npm run build",
"start": "PATH=../node_modules/.bin/:$PATH babel -d dist -w src",
"build": "PATH=../node_modules/.bin/:$PATH BABEL_ENV=production babel -d dist src",
"test": "PATH=../node_modules/.bin/:$PATH eslint src/ && flow src/"
}
}

View File

@@ -1 +0,0 @@
../../../../js/.babelrc

View File

@@ -1,7 +0,0 @@
// Copyright 2016 The Noms Authors. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');
// Allow console
module.exports.rules['no-console'] = 0;

43
samples/js/package.json Normal file
View File

@@ -0,0 +1,43 @@
{
"name": "noms-samples",
"version": "0.0.0",
"description": "Shared node modules",
"license": "Apache-2.0",
"dependencies": {
"@attic/eslintrc": "^3.1.0",
"@attic/noms": "file:../../js",
"babel-cli": "^6.10.1",
"babel-core": "^6.10.4",
"babel-generator": "^6.11.0",
"babel-plugin-syntax-async-functions": "^6.8.0",
"babel-plugin-syntax-flow": "^6.8.0",
"babel-plugin-transform-async-to-generator": "^6.8.0",
"babel-plugin-transform-class-properties": "^6.10.2",
"babel-plugin-transform-es2015-destructuring": "^6.9.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.10.3",
"babel-plugin-transform-es2015-parameters": "^6.9.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.11.1",
"babel-regenerator-runtime": "^6.5.0",
"chai": "^3.5.0",
"classnames": "^2.1.3",
"csv": "^1.1.0",
"flickr-oauth-and-upload": "^0.8.0",
"flow-bin": "^0.27.0",
"http-server": "^0.9.0",
"humanize": "^0.0.9",
"mocha": "^2.5.3",
"mz": "^2.4.0",
"node-fetch": "^1.5.2",
"oauth": "^0.9.14",
"react-dom": "^15.2.0",
"react": "^15.2.0",
"request": "^2.72.0",
"varint": "^4.0.0",
"yargs": "^4.7.1"
},
"scripts": {
"test": "exit 0"
}
}

View File

@@ -1 +0,0 @@
../../../js/.babelrc

View File

@@ -1,7 +0,0 @@
// Copyright 2016 The Noms Authors. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');
// Allow console
module.exports.rules['no-console'] = 0;

View File

@@ -1 +0,0 @@
../../../js/.flowconfig

View File

@@ -4,34 +4,11 @@
"main": "dist/main.js",
"version": "1.0.1",
"description": "noms example javascript thing",
"dependencies": {
"@attic/noms": "file:../../../js",
"babel-regenerator-runtime": "6.5.0"
},
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"chai": "3.5.0",
"flow-bin": "^0.25.0",
"mocha": "2.4.5",
"yargs": "^4.7.1"
},
"scripts": {
"start": "babel -d dist -w src",
"build": "BABEL_ENV=production babel -d dist src",
"test": "eslint src/ && flow src/"
"prepublish": "npm run build",
"start": "PATH=../node_modules/.bin/:$PATH babel -d dist -w src",
"build": "PATH=../node_modules/.bin/:$PATH BABEL_ENV=production babel -d dist src",
"test": "PATH=../node_modules/.bin/:$PATH eslint src/ && flow src/"
},
"keywords": [
"noms",

View File

@@ -45,7 +45,7 @@ async function main(): Promise<void> {
await hv.forEach((ref: Ref<XMLElement>) => {
// We force elemP to be 'any' here because the 'inning' entry and the 'Player' entry have
// different types that involve multiple levels of nested maps OR strings.
const elemP: any = ref.targetValue(input.database);
const elemP = ref.targetValue(input.database);
inningPs.push(maybeProcessInning(elemP));
playerPs.push(maybeProcessPitcher(elemP, pitchers));
});
@@ -93,7 +93,8 @@ function maybeProcessInning(ep: Promise<XMLElement>): Promise<?Map<string, Array
return ep.then(elem => elem.get('inning')).then(inn => inn && processInning(inn));
}
function processInning(inning: NomsMap<string, NomsMap>): Promise<Map<string, Array<Struct>>> {
function processInning(inning: NomsMap<string, NomsMap<*, *>>):
Promise<Map<string, Array<Struct>>> {
return Promise.all([inning.get('top'), inning.get('bottom')])
.then(halves => {
const halfPs = [];
@@ -112,7 +113,8 @@ function processInning(inning: NomsMap<string, NomsMap>): Promise<Map<string, Ar
return Promise.all(abPs);
})
.then(pitcherPitchList => {
const ret = new Map();
// any because of Flow.
const ret: any = new Map();
for (const pitcherPitches of pitcherPitchList) {
mergeInto(ret, pitcherPitches);
}
@@ -140,7 +142,7 @@ function processAbs(abs: List): Promise<PitcherPitches> {
});
}
function extendArray<T>(a: Array<T> = [], b: Array<T> = []): Array<T> {
function extendArray(a = [], b = []) {
b.forEach(e => a.push(e));
return a;
}

View File

@@ -1 +0,0 @@
../../../js/.babelrc

View File

@@ -1,5 +0,0 @@
// Copyright 2016 The Noms Authors. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');

View File

@@ -1 +0,0 @@
../../../js/.flowconfig

View File

@@ -1,35 +1,12 @@
{
"name": "noms-splore",
"license": "Apache-2.0",
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"@attic/noms": "^46.1.0",
"@attic/webpack-config": "^2.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"babel-regenerator-runtime": "6.5.0",
"classnames": "^2.1.3",
"flow-bin": "^0.25.0",
"http-server": "^0.8.5",
"react-dom": "^0.14.1",
"react": "^0.14.1",
"chai": "3.5.0",
"mocha": "2.4.5"
"dependencies": {
"@attic/webpack-config": "^2.1.0"
},
"scripts": {
"start": "python node_modules/@attic/webpack-config/run.py --src src/main.js --out out.js development",
"build": "python node_modules/@attic/webpack-config/run.py --src src/main.js --out out.js production",
"test": "eslint src/ && flow src/"
"start": "PATH=../node_modules/.bin/:$PATH python node_modules/@attic/webpack-config/run.py --src src/main.js --out out.js development",
"build": "PATH=../node_modules/.bin/:$PATH python node_modules/@attic/webpack-config/run.py --src src/main.js --out out.js production",
"test": "PATH=../node_modules/.bin/:$PATH eslint src/ && flow src/"
}
}

View File

@@ -34,7 +34,7 @@ let rootHash: Hash;
let database: Database;
let renderNode: ?HTMLElement;
let params;
let params = {};
window.onload = load;
window.onpopstate = load;
@@ -97,7 +97,7 @@ function handleChunkLoad(hash: Hash, val: any, fromHash: ?string) {
name: string) {
data.nodes[id] = {name: name};
sequence.items.forEach(tuple => {
const kid = process(hash, formatKeyString(tuple.value), id);
const kid = process(hash, formatKeyString(tuple.child), id);
if (kid) {
data.nodes[kid].isOpen = true;
@@ -237,7 +237,7 @@ function handleNodeClick(e: MouseEvent, id: string) {
}
}
class Prompt extends React.Component<void, {}, void> {
class Prompt extends React.Component<{}, {}, void> {
render(): React.Element {
const fontStyle: {[key: string]: any} = {
fontFamily: 'Menlo',

View File

@@ -29,7 +29,7 @@ type State = {
y: number,
};
export default class Node extends React.Component<void, Props, State> {
export default class Node extends React.Component<{}, Props, State> {
state: State;
constructor(props: Props) {

View File

@@ -1 +0,0 @@
../../../js/.flowconfig

View File

@@ -2,34 +2,10 @@
"name": "noms-url-fetch",
"license": "Apache-2.0",
"main": "dist/main.js",
"dependencies": {
"@attic/noms": "^42.0.0",
"babel-regenerator-runtime": "6.5.0",
"humanize": "0.0.9",
"yargs": "4.4.0"
},
"devDependencies": {
"@attic/eslintrc": "^3.1.0",
"babel-cli": "6.6.5",
"babel-core": "6.7.2",
"babel-generator": "6.7.2",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-syntax-flow": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-plugin-transform-class-properties": "6.6.0",
"babel-plugin-transform-es2015-destructuring": "6.6.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.0",
"babel-plugin-transform-es2015-parameters": "6.7.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"chai": "3.5.0",
"flow-bin": "^0.25.0",
"mocha": "2.4.5"
},
"scripts": {
"start": "babel -d dist -w src",
"build": "BABEL_ENV=production babel -d dist src",
"test": "eslint src/ && flow src/"
"prepublish": "npm run build",
"start": "PATH=../node_modules/.bin/:$PATH babel -d dist -w src",
"build": "PATH=../node_modules/.bin/:$PATH BABEL_ENV=production babel -d dist src",
"test": "PATH=../node_modules/.bin/:$PATH eslint src/ && flow src/"
}
}

View File

@@ -1 +0,0 @@
../../../../js/.babelrc

View File

@@ -1,7 +0,0 @@
// Copyright 2016 The Noms Authors. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
module.exports = require('@attic/eslintrc');
// Allow console
module.exports.rules['no-console'] = 0;

View File

@@ -19,6 +19,7 @@ def pushd(path):
def main():
lsfiles = subprocess.check_output(['git', 'ls-files']).split('\n')
lsfiles.sort(key = len) # Sort by shortest first to make sure we deal with parents first
for f in lsfiles:
path, name = os.path.split(f)
if name == 'package.json':