diff --git a/samples/js/.babelrc b/samples/js/.babelrc deleted file mode 120000 index 1e7d0c1803..0000000000 --- a/samples/js/.babelrc +++ /dev/null @@ -1 +0,0 @@ -../../js/.babelrc \ No newline at end of file diff --git a/samples/js/.flowconfig b/samples/js/.flowconfig deleted file mode 120000 index 6eef3a9002..0000000000 --- a/samples/js/.flowconfig +++ /dev/null @@ -1 +0,0 @@ -../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/.gitignore b/samples/js/.gitignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/samples/js/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/samples/js/aggregate/.flowconfig b/samples/js/aggregate/.flowconfig new file mode 120000 index 0000000000..69e272d83e --- /dev/null +++ b/samples/js/aggregate/.flowconfig @@ -0,0 +1 @@ +../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/aggregate/package.json b/samples/js/aggregate/package.json index a3164d8492..f386e36b43 100644 --- a/samples/js/aggregate/package.json +++ b/samples/js/aggregate/package.json @@ -2,8 +2,31 @@ "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": { - "prepublish": "npm run build", "start": "babel -d dist -w src", "build": "BABEL_ENV=production babel -d dist src", "test": "eslint src/ && flow src/" diff --git a/samples/js/aggregate/src/.babelrc b/samples/js/aggregate/src/.babelrc new file mode 120000 index 0000000000..72e2bfd670 --- /dev/null +++ b/samples/js/aggregate/src/.babelrc @@ -0,0 +1 @@ +../../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/aggregate/src/.eslintrc.js b/samples/js/aggregate/src/.eslintrc.js new file mode 100644 index 0000000000..327a73a305 --- /dev/null +++ b/samples/js/aggregate/src/.eslintrc.js @@ -0,0 +1,7 @@ +// 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; diff --git a/samples/js/aggregate/src/main.js b/samples/js/aggregate/src/main.js index b37e60cb73..a163b94a7e 100644 --- a/samples/js/aggregate/src/main.js +++ b/samples/js/aggregate/src/main.js @@ -59,11 +59,11 @@ async function main(): Promise { return; } - const commit = await rv.targetValue(input.database); + const commit = await rv.targetValue(input.store); let out = Promise.resolve(new Map()); - await walk(commit.value, input.database, cv => { + await walk(commit.value, input.store, cv => { if (!(cv instanceof Struct) || cv.type.name !== args.struct) { return; } @@ -82,7 +82,7 @@ async function main(): Promise { return true; }); - await outSpec.dataset().commit(await out); + await outSpec.set().commit(await out); } function quit(err: string): Function { diff --git a/samples/js/bar-chart/.babelrc b/samples/js/bar-chart/.babelrc new file mode 120000 index 0000000000..2036edcccd --- /dev/null +++ b/samples/js/bar-chart/.babelrc @@ -0,0 +1 @@ +../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/bar-chart/.eslintrc.js b/samples/js/bar-chart/.eslintrc.js new file mode 100644 index 0000000000..a6a3d97bd5 --- /dev/null +++ b/samples/js/bar-chart/.eslintrc.js @@ -0,0 +1,5 @@ +// 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'); diff --git a/samples/js/bar-chart/.flowconfig b/samples/js/bar-chart/.flowconfig new file mode 120000 index 0000000000..69e272d83e --- /dev/null +++ b/samples/js/bar-chart/.flowconfig @@ -0,0 +1 @@ +../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/bar-chart/package.json b/samples/js/bar-chart/package.json index 2a6d2ec3d1..833e81f581 100644 --- a/samples/js/bar-chart/package.json +++ b/samples/js/bar-chart/package.json @@ -1,8 +1,27 @@ { "name": "noms-bar-chart", "license": "Apache-2.0", - "dependencies": { - "@attic/webpack-config": "^2.1.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" }, "scripts": { "start": "python node_modules/@attic/webpack-config/run.py --src src/main.js --out out.js development", diff --git a/samples/js/codec-perf-rig/.flowconfig b/samples/js/codec-perf-rig/.flowconfig new file mode 120000 index 0000000000..69e272d83e --- /dev/null +++ b/samples/js/codec-perf-rig/.flowconfig @@ -0,0 +1 @@ +../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/codec-perf-rig/package.json b/samples/js/codec-perf-rig/package.json index 762a139f9c..aec18c02b9 100644 --- a/samples/js/codec-perf-rig/package.json +++ b/samples/js/codec-perf-rig/package.json @@ -2,8 +2,32 @@ "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": { - "prepublish": "npm run build", "start": "babel -d dist -w src", "build": "BABEL_ENV=production babel -d dist src", "test": "eslint src/ && flow src/" diff --git a/samples/js/codec-perf-rig/src/.babelrc b/samples/js/codec-perf-rig/src/.babelrc new file mode 120000 index 0000000000..72e2bfd670 --- /dev/null +++ b/samples/js/codec-perf-rig/src/.babelrc @@ -0,0 +1 @@ +../../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/codec-perf-rig/src/.eslintrc.js b/samples/js/codec-perf-rig/src/.eslintrc.js new file mode 100644 index 0000000000..327a73a305 --- /dev/null +++ b/samples/js/codec-perf-rig/src/.eslintrc.js @@ -0,0 +1,7 @@ +// 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; diff --git a/samples/js/counter/.flowconfig b/samples/js/counter/.flowconfig new file mode 120000 index 0000000000..69e272d83e --- /dev/null +++ b/samples/js/counter/.flowconfig @@ -0,0 +1 @@ +../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/counter/package.json b/samples/js/counter/package.json index f2dcf403d5..bbfd1e2080 100644 --- a/samples/js/counter/package.json +++ b/samples/js/counter/package.json @@ -4,8 +4,31 @@ "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": { - "prepublish": "npm run build", "start": "babel -d dist -w src", "build": "BABEL_ENV=production babel -d dist src", "test": "eslint src/ && flow src/" diff --git a/samples/js/counter/src/.babelrc b/samples/js/counter/src/.babelrc new file mode 120000 index 0000000000..72e2bfd670 --- /dev/null +++ b/samples/js/counter/src/.babelrc @@ -0,0 +1 @@ +../../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/counter/src/.eslintrc.js b/samples/js/counter/src/.eslintrc.js new file mode 100644 index 0000000000..327a73a305 --- /dev/null +++ b/samples/js/counter/src/.eslintrc.js @@ -0,0 +1,7 @@ +// 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; diff --git a/samples/js/csv/.babelrc b/samples/js/csv/.babelrc new file mode 120000 index 0000000000..2036edcccd --- /dev/null +++ b/samples/js/csv/.babelrc @@ -0,0 +1 @@ +../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/csv/.eslintrc.js b/samples/js/csv/.eslintrc.js new file mode 100644 index 0000000000..a6a3d97bd5 --- /dev/null +++ b/samples/js/csv/.eslintrc.js @@ -0,0 +1,5 @@ +// 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'); diff --git a/samples/js/csv/.flowconfig b/samples/js/csv/.flowconfig new file mode 120000 index 0000000000..69e272d83e --- /dev/null +++ b/samples/js/csv/.flowconfig @@ -0,0 +1 @@ +../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/csv/package.json b/samples/js/csv/package.json index c6629579ca..f6939d089d 100644 --- a/samples/js/csv/package.json +++ b/samples/js/csv/package.json @@ -4,8 +4,33 @@ "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": { - "prepublish": "npm run build", "start": "babel -d dist -w src", "build": "BABEL_ENV=production babel -d dist src", "test": "eslint src/ && flow src/" diff --git a/samples/js/encode-perf-rig/.flowconfig b/samples/js/encode-perf-rig/.flowconfig new file mode 120000 index 0000000000..69e272d83e --- /dev/null +++ b/samples/js/encode-perf-rig/.flowconfig @@ -0,0 +1 @@ +../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/encode-perf-rig/package.json b/samples/js/encode-perf-rig/package.json index deae719104..97b60220bd 100644 --- a/samples/js/encode-perf-rig/package.json +++ b/samples/js/encode-perf-rig/package.json @@ -1,8 +1,34 @@ { "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": { - "prepublish": "npm run build", "start": "babel -d dist -w src", "build": "BABEL_ENV=production babel -d dist src", "test": "eslint src/ && flow src/" diff --git a/samples/js/encode-perf-rig/src/.babelrc b/samples/js/encode-perf-rig/src/.babelrc new file mode 120000 index 0000000000..72e2bfd670 --- /dev/null +++ b/samples/js/encode-perf-rig/src/.babelrc @@ -0,0 +1 @@ +../../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/encode-perf-rig/src/.eslintrc.js b/samples/js/encode-perf-rig/src/.eslintrc.js new file mode 100644 index 0000000000..9d8587f003 --- /dev/null +++ b/samples/js/encode-perf-rig/src/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = require('@attic/eslintrc'); +// Allow console +module.exports.rules['no-console'] = 0; diff --git a/samples/js/fb/find-photos/.flowconfig b/samples/js/fb/find-photos/.flowconfig new file mode 120000 index 0000000000..0c18a601c8 --- /dev/null +++ b/samples/js/fb/find-photos/.flowconfig @@ -0,0 +1 @@ +../../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/fb/find-photos/package.json b/samples/js/fb/find-photos/package.json index 6acdbcd6fd..56eda23023 100644 --- a/samples/js/fb/find-photos/package.json +++ b/samples/js/fb/find-photos/package.json @@ -3,8 +3,31 @@ "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": { - "prepublish": "npm run build", "start": "babel -d dist -w src", "build": "babel -d dist src", "test": "eslint src/ && flow src/" diff --git a/samples/js/fb/find-photos/src/.babelrc b/samples/js/fb/find-photos/src/.babelrc new file mode 120000 index 0000000000..0a18a23b86 --- /dev/null +++ b/samples/js/fb/find-photos/src/.babelrc @@ -0,0 +1 @@ +../../../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/.eslintrc.js b/samples/js/fb/find-photos/src/.eslintrc.js similarity index 95% rename from samples/js/.eslintrc.js rename to samples/js/fb/find-photos/src/.eslintrc.js index a4ee56d8cc..f1b9513ab4 100644 --- a/samples/js/.eslintrc.js +++ b/samples/js/fb/find-photos/src/.eslintrc.js @@ -3,7 +3,6 @@ // 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; diff --git a/samples/js/fb/find-photos/src/main.js b/samples/js/fb/find-photos/src/main.js index dfb57010f1..c660403cb1 100644 --- a/samples/js/fb/find-photos/src/main.js +++ b/samples/js/fb/find-photos/src/main.js @@ -77,7 +77,7 @@ async function main(): Promise { if (isSubtype(placeType, v.type)) { photo.geoposition = getGeo(v); } - result = result.then(r => r.add(newStruct('Photo', photo))); + result = result.then(r => r.insert(newStruct('Photo', photo))); return true; } }); diff --git a/samples/js/fb/slurp/.flowconfig b/samples/js/fb/slurp/.flowconfig new file mode 120000 index 0000000000..0c18a601c8 --- /dev/null +++ b/samples/js/fb/slurp/.flowconfig @@ -0,0 +1 @@ +../../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/fb/slurp/package.json b/samples/js/fb/slurp/package.json index 185bd9f46a..520b9cf609 100644 --- a/samples/js/fb/slurp/package.json +++ b/samples/js/fb/slurp/package.json @@ -3,8 +3,32 @@ "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": { - "prepublish": "npm run build", "start": "babel -d dist -w src", "build": "babel -d dist src", "test": "eslint src/ && flow src/" diff --git a/samples/js/fb/slurp/src/.babelrc b/samples/js/fb/slurp/src/.babelrc new file mode 120000 index 0000000000..0a18a23b86 --- /dev/null +++ b/samples/js/fb/slurp/src/.babelrc @@ -0,0 +1 @@ +../../../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/fb/slurp/src/.eslintrc.js b/samples/js/fb/slurp/src/.eslintrc.js new file mode 100644 index 0000000000..cdb06129d0 --- /dev/null +++ b/samples/js/fb/slurp/src/.eslintrc.js @@ -0,0 +1,8 @@ +// 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; diff --git a/samples/js/flickr/find-photos/.flowconfig b/samples/js/flickr/find-photos/.flowconfig new file mode 120000 index 0000000000..0c18a601c8 --- /dev/null +++ b/samples/js/flickr/find-photos/.flowconfig @@ -0,0 +1 @@ +../../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/flickr/find-photos/package.json b/samples/js/flickr/find-photos/package.json index a9330af9c1..d5ee74ec87 100644 --- a/samples/js/flickr/find-photos/package.json +++ b/samples/js/flickr/find-photos/package.json @@ -3,8 +3,33 @@ "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": { - "prepublish": "npm run build", "start": "babel -d dist -w src", "build": "babel -d dist src", "test": "eslint src/ && flow src/" diff --git a/samples/js/flickr/find-photos/src/.babelrc b/samples/js/flickr/find-photos/src/.babelrc new file mode 120000 index 0000000000..0a18a23b86 --- /dev/null +++ b/samples/js/flickr/find-photos/src/.babelrc @@ -0,0 +1 @@ +../../../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/flickr/find-photos/src/.eslintrc.js b/samples/js/flickr/find-photos/src/.eslintrc.js new file mode 100644 index 0000000000..d10f983b6c --- /dev/null +++ b/samples/js/flickr/find-photos/src/.eslintrc.js @@ -0,0 +1,8 @@ +// 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; diff --git a/samples/js/flickr/find-photos/src/main.js b/samples/js/flickr/find-photos/src/main.js index 6249709ca9..68e1019731 100644 --- a/samples/js/flickr/find-photos/src/main.js +++ b/samples/js/flickr/find-photos/src/main.js @@ -49,19 +49,13 @@ const sizeTypes = sizes.map(s => // } | // ... for all the image size suffixes ... // } -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); -})); +const imageType = makeUnionType(sizeTypes.map(st => + makeStructType('', Object.assign(({ + title: stringType, + tags: stringType, + latitude: flickrNum, + longitude: flickrNum, + }:Object), st.desc.fields)))); main().catch(ex => { console.error(ex); @@ -97,7 +91,7 @@ async function main(): Promise { photo.geoposition = geo; } - result = result.then(r => r.add(newStruct('Photo', photo))); + result = result.then(r => r.insert(newStruct('Photo', photo))); return true; } return false; diff --git a/samples/js/flickr/slurp/.flowconfig b/samples/js/flickr/slurp/.flowconfig new file mode 120000 index 0000000000..0c18a601c8 --- /dev/null +++ b/samples/js/flickr/slurp/.flowconfig @@ -0,0 +1 @@ +../../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/flickr/slurp/package.json b/samples/js/flickr/slurp/package.json index 2561f16a92..6d39c0afcb 100644 --- a/samples/js/flickr/slurp/package.json +++ b/samples/js/flickr/slurp/package.json @@ -3,8 +3,34 @@ "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": { - "prepublish": "npm run build", "start": "babel -d dist -w src", "build": "babel -d dist src", "test": "eslint src/ && flow src/" diff --git a/samples/js/flickr/slurp/src/.babelrc b/samples/js/flickr/slurp/src/.babelrc new file mode 120000 index 0000000000..0a18a23b86 --- /dev/null +++ b/samples/js/flickr/slurp/src/.babelrc @@ -0,0 +1 @@ +../../../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/flickr/slurp/src/.eslintrc.js b/samples/js/flickr/slurp/src/.eslintrc.js new file mode 100644 index 0000000000..b54147b3ce --- /dev/null +++ b/samples/js/flickr/slurp/src/.eslintrc.js @@ -0,0 +1,8 @@ +// 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; diff --git a/samples/js/flickr/slurp/src/main.js b/samples/js/flickr/slurp/src/main.js index 1f31f785ad..e5dbbbb49c 100644 --- a/samples/js/flickr/slurp/src/main.js +++ b/samples/js/flickr/slurp/src/main.js @@ -76,11 +76,13 @@ async function main(): Promise { const photosetsJSON = await getPhotosetsJSON(); let seen = 0; - 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)); + 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)); process.stdout.write(clearLine); return out.commit(newStruct('', { diff --git a/samples/js/fs/.flowconfig b/samples/js/fs/.flowconfig new file mode 120000 index 0000000000..69e272d83e --- /dev/null +++ b/samples/js/fs/.flowconfig @@ -0,0 +1 @@ +../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/fs/package.json b/samples/js/fs/package.json index 8120ba86c4..aefd922aaf 100644 --- a/samples/js/fs/package.json +++ b/samples/js/fs/package.json @@ -2,8 +2,34 @@ "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": { - "prepublish": "npm run build", "start": "babel -d dist -w src", "build": "BABEL_ENV=production babel -d dist src", "test": "eslint src/ && flow src/" diff --git a/samples/js/fs/src/.babelrc b/samples/js/fs/src/.babelrc new file mode 120000 index 0000000000..72e2bfd670 --- /dev/null +++ b/samples/js/fs/src/.babelrc @@ -0,0 +1 @@ +../../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/fs/src/.eslintrc.js b/samples/js/fs/src/.eslintrc.js new file mode 100644 index 0000000000..327a73a305 --- /dev/null +++ b/samples/js/fs/src/.eslintrc.js @@ -0,0 +1,7 @@ +// 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; diff --git a/samples/js/hash-perf-rig/.flowconfig b/samples/js/hash-perf-rig/.flowconfig new file mode 120000 index 0000000000..69e272d83e --- /dev/null +++ b/samples/js/hash-perf-rig/.flowconfig @@ -0,0 +1 @@ +../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/hash-perf-rig/package.json b/samples/js/hash-perf-rig/package.json index 9f1bef88b3..312ca81c73 100644 --- a/samples/js/hash-perf-rig/package.json +++ b/samples/js/hash-perf-rig/package.json @@ -2,8 +2,34 @@ "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": { - "prepublish": "npm run build", "start": "babel -d dist -w src", "build": "BABEL_ENV=production babel -d dist src", "test": "eslint src/ && flow src/" diff --git a/samples/js/hash-perf-rig/src/.babelrc b/samples/js/hash-perf-rig/src/.babelrc new file mode 120000 index 0000000000..72e2bfd670 --- /dev/null +++ b/samples/js/hash-perf-rig/src/.babelrc @@ -0,0 +1 @@ +../../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/hash-perf-rig/src/.eslintrc.js b/samples/js/hash-perf-rig/src/.eslintrc.js new file mode 100644 index 0000000000..327a73a305 --- /dev/null +++ b/samples/js/hash-perf-rig/src/.eslintrc.js @@ -0,0 +1,7 @@ +// 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; diff --git a/samples/js/package.json b/samples/js/package.json deleted file mode 100644 index cd3de855cf..0000000000 --- a/samples/js/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "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" - } -} diff --git a/samples/js/pitch-index/.babelrc b/samples/js/pitch-index/.babelrc new file mode 120000 index 0000000000..2036edcccd --- /dev/null +++ b/samples/js/pitch-index/.babelrc @@ -0,0 +1 @@ +../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/pitch-index/.eslintrc.js b/samples/js/pitch-index/.eslintrc.js new file mode 100644 index 0000000000..327a73a305 --- /dev/null +++ b/samples/js/pitch-index/.eslintrc.js @@ -0,0 +1,7 @@ +// 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; diff --git a/samples/js/pitch-index/.flowconfig b/samples/js/pitch-index/.flowconfig new file mode 120000 index 0000000000..69e272d83e --- /dev/null +++ b/samples/js/pitch-index/.flowconfig @@ -0,0 +1 @@ +../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/pitch-index/package.json b/samples/js/pitch-index/package.json index b12c71397d..c30fb63abd 100644 --- a/samples/js/pitch-index/package.json +++ b/samples/js/pitch-index/package.json @@ -4,8 +4,31 @@ "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": { - "prepublish": "npm run build", "start": "babel -d dist -w src", "build": "BABEL_ENV=production babel -d dist src", "test": "eslint src/ && flow src/" diff --git a/samples/js/splore/.babelrc b/samples/js/splore/.babelrc new file mode 120000 index 0000000000..2036edcccd --- /dev/null +++ b/samples/js/splore/.babelrc @@ -0,0 +1 @@ +../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/splore/.eslintrc.js b/samples/js/splore/.eslintrc.js new file mode 100644 index 0000000000..a6a3d97bd5 --- /dev/null +++ b/samples/js/splore/.eslintrc.js @@ -0,0 +1,5 @@ +// 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'); diff --git a/samples/js/splore/.flowconfig b/samples/js/splore/.flowconfig new file mode 120000 index 0000000000..69e272d83e --- /dev/null +++ b/samples/js/splore/.flowconfig @@ -0,0 +1 @@ +../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/splore/package.json b/samples/js/splore/package.json index 575e44be28..aede2501b9 100644 --- a/samples/js/splore/package.json +++ b/samples/js/splore/package.json @@ -1,8 +1,31 @@ { "name": "noms-splore", "license": "Apache-2.0", - "dependencies": { - "@attic/webpack-config": "^2.1.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" }, "scripts": { "start": "python node_modules/@attic/webpack-config/run.py --src src/main.js --out out.js development", diff --git a/samples/js/splore/src/main.js b/samples/js/splore/src/main.js index 1a808f2e57..f4f28ffed2 100644 --- a/samples/js/splore/src/main.js +++ b/samples/js/splore/src/main.js @@ -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.child), id); + const kid = process(hash, formatKeyString(tuple.value), id); if (kid) { data.nodes[kid].isOpen = true; diff --git a/samples/js/url_fetch/.flowconfig b/samples/js/url_fetch/.flowconfig new file mode 120000 index 0000000000..69e272d83e --- /dev/null +++ b/samples/js/url_fetch/.flowconfig @@ -0,0 +1 @@ +../../../js/.flowconfig \ No newline at end of file diff --git a/samples/js/url_fetch/package.json b/samples/js/url_fetch/package.json index d324aeb74b..8781e9d0ab 100644 --- a/samples/js/url_fetch/package.json +++ b/samples/js/url_fetch/package.json @@ -2,8 +2,32 @@ "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": { - "prepublish": "npm run build", "start": "babel -d dist -w src", "build": "BABEL_ENV=production babel -d dist src", "test": "eslint src/ && flow src/" diff --git a/samples/js/url_fetch/src/.babelrc b/samples/js/url_fetch/src/.babelrc new file mode 120000 index 0000000000..72e2bfd670 --- /dev/null +++ b/samples/js/url_fetch/src/.babelrc @@ -0,0 +1 @@ +../../../../js/.babelrc \ No newline at end of file diff --git a/samples/js/url_fetch/src/.eslintrc.js b/samples/js/url_fetch/src/.eslintrc.js new file mode 100644 index 0000000000..327a73a305 --- /dev/null +++ b/samples/js/url_fetch/src/.eslintrc.js @@ -0,0 +1,7 @@ +// 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;