From a20d2a6db4f29187f1c3708c82fc7c0821ffd17e Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Mon, 12 Jun 2023 08:37:03 +0100 Subject: [PATCH] GH-4093 Bump ObservableHQ Versions Fixes #4093 Signed-off-by: Gordon Smith --- package-lock.json | 287 +++++++++--------- packages/observable-md/README.md | 3 + packages/observable-md/package.json | 8 +- packages/observable-md/rollup.config.js | 2 +- packages/observablehq-compiler/package.json | 4 +- tests/test-data/src/coreTests.ts | 2 +- tests/test-observable-md/src/index.spec.ts | 3 - .../test-observable-md/src/observable.spec.ts | 204 ------------- .../.vscode/launch.json | 12 + .../.vscode/tasks.json | 0 .../CHANGELOG.md | 0 .../karma.config.js | 59 ++++ .../package.json | 5 +- .../src/index.spec.ts | 1 + .../src/observable.spec.ts | 49 +++ .../test.html | 0 .../tsconfig.json | 2 +- .../webpack.config.js | 2 +- 18 files changed, 279 insertions(+), 364 deletions(-) delete mode 100644 tests/test-observable-md/src/index.spec.ts delete mode 100644 tests/test-observable-md/src/observable.spec.ts rename tests/{test-observable-md => test-observablehq-compiler}/.vscode/launch.json (83%) rename tests/{test-observable-md => test-observablehq-compiler}/.vscode/tasks.json (100%) rename tests/{test-observable-md => test-observablehq-compiler}/CHANGELOG.md (100%) create mode 100644 tests/test-observablehq-compiler/karma.config.js rename tests/{test-observable-md => test-observablehq-compiler}/package.json (84%) create mode 100644 tests/test-observablehq-compiler/src/index.spec.ts create mode 100644 tests/test-observablehq-compiler/src/observable.spec.ts rename tests/{test-observable-md => test-observablehq-compiler}/test.html (100%) rename tests/{test-observable-md => test-observablehq-compiler}/tsconfig.json (93%) rename tests/{test-observable-md => test-observablehq-compiler}/webpack.config.js (90%) diff --git a/package-lock.json b/package-lock.json index f7b8cd9a73..30745c688b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1494,8 +1494,8 @@ "resolved": "tests/test-marshaller", "link": true }, - "node_modules/@hpcc-js/test-observable-md": { - "resolved": "tests/test-observable-md", + "node_modules/@hpcc-js/test-observablehq-compiler": { + "resolved": "tests/test-observablehq-compiler", "link": true }, "node_modules/@hpcc-js/test-other": { @@ -3975,10 +3975,9 @@ } }, "node_modules/@observablehq/inspector": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@observablehq/inspector/-/inspector-3.2.4.tgz", - "integrity": "sha512-P1TdR95pvvNri0XV6X/R+s9XO70d8ozhOp2cMXEJ2zsiGzB8VjOdrJgRJyLjEJ0OJy7jP9VXFiC1Hej8WgsF5A==", - "dev": true, + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@observablehq/inspector/-/inspector-5.0.0.tgz", + "integrity": "sha512-Vvg/TQdsZTUaeYbH0IKxYEz37FbRO6kdowoz2PrHLQif54NC1CjEihEjg+ZMSBn587GQxTFABu0CGkFZgtR1UQ==", "dependencies": { "isoformat": "^0.2.0" } @@ -3987,7 +3986,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/@observablehq/parser/-/parser-6.0.0.tgz", "integrity": "sha512-iLme7/6LlyYO7Hqyi9evU47kyaFKl9deFcWROBs9cmkQuUoZ8Nr9vqRJ9Sc3QfeVvpueRZT3C/fT+jhYIeUlOw==", - "dev": true, "dependencies": { "acorn": "8", "acorn-walk": "8" @@ -3997,23 +3995,36 @@ } }, "node_modules/@observablehq/runtime": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@observablehq/runtime/-/runtime-4.28.0.tgz", - "integrity": "sha512-C4f/ha9dlt/9StGj0zW6SK5oZy/mA00O0h0hj1eWPdGFUtxbpRmQwDVi1/tgnD2qEkJkuZmuuQTYLph7GhBZPA==", - "dev": true, + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/@observablehq/runtime/-/runtime-5.7.4.tgz", + "integrity": "sha512-hUEovJNFiCkwoVdgnAbooc4lNCHhpmhlyPQMlGSBnlhuADOzaWBckGQpVy4ssCwnlKZb5wJLUxLraS3CqkM1Sg==", "dependencies": { - "@observablehq/inspector": "^3.2.2", - "@observablehq/stdlib": "^3.4.1" + "@observablehq/inspector": "^5.0.0", + "@observablehq/stdlib": "^5.0.0" } }, "node_modules/@observablehq/stdlib": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@observablehq/stdlib/-/stdlib-3.20.0.tgz", - "integrity": "sha512-7T6g2oVbwnDWDjczIryoPEULOyt+ICCLlDKyUMYRZkfdpxQp0Gvg238xTVU3z70MeXY9vNksvqdH2Lbo5jYYyA==", - "dev": true, + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/@observablehq/stdlib/-/stdlib-5.7.4.tgz", + "integrity": "sha512-JBAONxyE6K2EO5ZkpPycyImXygvpW2Z/JiYhxx5Iuox6i9emu7RzOuFsoswisLMgnlMNJo35j2py+fnfdngvZA==", "dependencies": { - "d3-dsv": "^2.0.0", + "d3-array": "^3.2.0", + "d3-dsv": "^3.0.1", "d3-require": "^1.3.0" + }, + "engines": { + "node": ">=14.5.0" + } + }, + "node_modules/@observablehq/stdlib/node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" } }, "node_modules/@octokit/auth-token": { @@ -5866,7 +5877,6 @@ "version": "8.8.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -5896,7 +5906,6 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true, "engines": { "node": ">=0.4.0" } @@ -8420,25 +8429,46 @@ } }, "node_modules/d3-dsv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-2.0.0.tgz", - "integrity": "sha512-E+Pn8UJYx9mViuIUkoc93gJGGYut6mSDKy2+XaPwccwkRGlR+LO97L2VCCRjQivTwLHkSnAJG7yo00BWY6QM+w==", - "dev": true, + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", + "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", "dependencies": { - "commander": "2", - "iconv-lite": "0.4", + "commander": "7", + "iconv-lite": "0.6", "rw": "1" }, "bin": { - "csv2json": "bin/dsv2json", - "csv2tsv": "bin/dsv2dsv", - "dsv2dsv": "bin/dsv2dsv", - "dsv2json": "bin/dsv2json", - "json2csv": "bin/json2dsv", - "json2dsv": "bin/json2dsv", - "json2tsv": "bin/json2dsv", - "tsv2csv": "bin/dsv2dsv", - "tsv2json": "bin/dsv2json" + "csv2json": "bin/dsv2json.js", + "csv2tsv": "bin/dsv2dsv.js", + "dsv2dsv": "bin/dsv2dsv.js", + "dsv2json": "bin/dsv2json.js", + "json2csv": "bin/json2dsv.js", + "json2dsv": "bin/json2dsv.js", + "json2tsv": "bin/json2dsv.js", + "tsv2csv": "bin/dsv2dsv.js", + "tsv2json": "bin/dsv2json.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dsv/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/d3-dsv/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, "node_modules/d3-ease": { @@ -8597,8 +8627,7 @@ "node_modules/d3-require": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/d3-require/-/d3-require-1.3.0.tgz", - "integrity": "sha512-XaNc2azaAwXhGjmCMtxlD+AowpMfLimVsAoTMpqrvb8CWoA4QqyV12mc4Ue6KSoDvfuS831tsumfhDYxGd4FGA==", - "dev": true + "integrity": "sha512-XaNc2azaAwXhGjmCMtxlD+AowpMfLimVsAoTMpqrvb8CWoA4QqyV12mc4Ue6KSoDvfuS831tsumfhDYxGd4FGA==" }, "node_modules/d3-sankey": { "version": "0.12.3", @@ -8832,14 +8861,6 @@ "d3-transition": "1" } }, - "node_modules/d3/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "engines": { - "node": ">= 10" - } - }, "node_modules/d3/node_modules/d3-array": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.0.tgz", @@ -8913,30 +8934,6 @@ "node": ">=12" } }, - "node_modules/d3/node_modules/d3-dsv": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", - "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", - "dependencies": { - "commander": "7", - "iconv-lite": "0.6", - "rw": "1" - }, - "bin": { - "csv2json": "bin/dsv2json.js", - "csv2tsv": "bin/dsv2dsv.js", - "dsv2dsv": "bin/dsv2dsv.js", - "dsv2json": "bin/dsv2json.js", - "json2csv": "bin/json2dsv.js", - "json2dsv": "bin/json2dsv.js", - "json2tsv": "bin/json2dsv.js", - "tsv2csv": "bin/dsv2dsv.js", - "tsv2json": "bin/dsv2json.js" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/d3/node_modules/d3-ease": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", @@ -9128,17 +9125,6 @@ "node": ">=12" } }, - "node_modules/d3/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/d3v4-bullet": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/d3v4-bullet/-/d3v4-bullet-1.0.7.tgz", @@ -12795,8 +12781,7 @@ "node_modules/isoformat": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/isoformat/-/isoformat-0.2.1.tgz", - "integrity": "sha512-tFLRAygk9NqrRPhJSnNGh7g7oaVWDwR0wKh/GM2LgmPa50Eg4UfyaCO4I8k6EqJHl1/uh2RAD6g06n5ygEnrjQ==", - "dev": true + "integrity": "sha512-tFLRAygk9NqrRPhJSnNGh7g7oaVWDwR0wKh/GM2LgmPa50Eg4UfyaCO4I8k6EqJHl1/uh2RAD6g06n5ygEnrjQ==" }, "node_modules/jackspeak": { "version": "2.2.1", @@ -23089,7 +23074,7 @@ "d3-geo": "^1", "d3-selection": "^1", "leaflet-draw": "1.0.4", - "leaflet.gridlayer.googlemutant": "git+ssh://git@github.com/GordonSmith/Leaflet.GridLayer.GoogleMutant.git#76640a02252b784e3463c076a1ce1924682c270f", + "leaflet.gridlayer.googlemutant": "https://github.com/GordonSmith/Leaflet.GridLayer.GoogleMutant#master", "leaflet.heat": "0.2.0", "leaflet.markercluster": "1.5.3", "simpleheat": "0.4.0", @@ -23301,7 +23286,7 @@ }, "devDependencies": { "@hpcc-js/bundle": "^2.11.3", - "@observablehq/runtime": "4.28.0", + "@observablehq/runtime": "5.7.4", "d3-require": "^1", "tslib": "2.4.1" } @@ -23335,7 +23320,7 @@ }, "devDependencies": { "@hpcc-js/bundle": "^2.11.3", - "@observablehq/runtime": "4.28.0", + "@observablehq/runtime": "5.7.4", "tslib": "2.4.1" } }, @@ -23832,6 +23817,7 @@ }, "tests/test-observable-md": { "name": "@hpcc-js/test-observable-md", + "extraneous": true, "dependencies": { "@hpcc-js/common": "^2.71.8", "@hpcc-js/observable-md": "^2.54.9", @@ -23843,7 +23829,22 @@ "file-loader": "5.1.0" } }, - "tests/test-observable-md/node_modules/@types/mocha": { + "tests/test-observablehq-compiler": { + "name": "@hpcc-js/test-observablehq-compiler", + "dependencies": { + "@hpcc-js/common": "^2.71.8", + "@hpcc-js/observablehq-compiler": "^1.2.6", + "@observablehq/parser": "6.0.0", + "@observablehq/runtime": "5.7.4", + "es6-promise": "4.2.8", + "simulate-event": "1.4.0" + }, + "devDependencies": { + "@types/mocha": "5.2.7", + "file-loader": "5.1.0" + } + }, + "tests/test-observablehq-compiler/node_modules/@types/mocha": { "version": "5.2.7", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", @@ -25478,7 +25479,7 @@ "d3-selection": "^1", "leaflet": "1.9.4", "leaflet-draw": "1.0.4", - "leaflet.gridlayer.googlemutant": "git+ssh://git@github.com/GordonSmith/Leaflet.GridLayer.GoogleMutant.git#76640a02252b784e3463c076a1ce1924682c270f", + "leaflet.gridlayer.googlemutant": "https://github.com/GordonSmith/Leaflet.GridLayer.GoogleMutant#master", "leaflet.heat": "0.2.0", "leaflet.markercluster": "1.5.3", "simpleheat": "0.4.0", @@ -25658,7 +25659,7 @@ "@hpcc-js/common": "^2.71.9", "@hpcc-js/observable-shim": "^2.5.0", "@hpcc-js/util": "^2.50.3", - "@observablehq/runtime": "4.28.0", + "@observablehq/runtime": "5.7.4", "d3-require": "^1", "tslib": "2.4.1" }, @@ -25683,7 +25684,7 @@ "requires": { "@hpcc-js/bundle": "^2.11.3", "@hpcc-js/observable-shim": "^2.5.0", - "@observablehq/runtime": "4.28.0", + "@observablehq/runtime": "5.7.4", "node-fetch": "3.3.1", "tslib": "2.4.1", "yargs": "17.7.2" @@ -26076,11 +26077,13 @@ } } }, - "@hpcc-js/test-observable-md": { - "version": "file:tests/test-observable-md", + "@hpcc-js/test-observablehq-compiler": { + "version": "file:tests/test-observablehq-compiler", "requires": { "@hpcc-js/common": "^2.71.8", - "@hpcc-js/observable-md": "^2.54.9", + "@hpcc-js/observablehq-compiler": "^1.2.6", + "@observablehq/parser": "6.0.0", + "@observablehq/runtime": "5.7.4", "@types/mocha": "5.2.7", "es6-promise": "4.2.8", "file-loader": "5.1.0", @@ -28446,10 +28449,9 @@ } }, "@observablehq/inspector": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@observablehq/inspector/-/inspector-3.2.4.tgz", - "integrity": "sha512-P1TdR95pvvNri0XV6X/R+s9XO70d8ozhOp2cMXEJ2zsiGzB8VjOdrJgRJyLjEJ0OJy7jP9VXFiC1Hej8WgsF5A==", - "dev": true, + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@observablehq/inspector/-/inspector-5.0.0.tgz", + "integrity": "sha512-Vvg/TQdsZTUaeYbH0IKxYEz37FbRO6kdowoz2PrHLQif54NC1CjEihEjg+ZMSBn587GQxTFABu0CGkFZgtR1UQ==", "requires": { "isoformat": "^0.2.0" } @@ -28458,30 +28460,38 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/@observablehq/parser/-/parser-6.0.0.tgz", "integrity": "sha512-iLme7/6LlyYO7Hqyi9evU47kyaFKl9deFcWROBs9cmkQuUoZ8Nr9vqRJ9Sc3QfeVvpueRZT3C/fT+jhYIeUlOw==", - "dev": true, "requires": { "acorn": "8", "acorn-walk": "8" } }, "@observablehq/runtime": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@observablehq/runtime/-/runtime-4.28.0.tgz", - "integrity": "sha512-C4f/ha9dlt/9StGj0zW6SK5oZy/mA00O0h0hj1eWPdGFUtxbpRmQwDVi1/tgnD2qEkJkuZmuuQTYLph7GhBZPA==", - "dev": true, + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/@observablehq/runtime/-/runtime-5.7.4.tgz", + "integrity": "sha512-hUEovJNFiCkwoVdgnAbooc4lNCHhpmhlyPQMlGSBnlhuADOzaWBckGQpVy4ssCwnlKZb5wJLUxLraS3CqkM1Sg==", "requires": { - "@observablehq/inspector": "^3.2.2", - "@observablehq/stdlib": "^3.4.1" + "@observablehq/inspector": "^5.0.0", + "@observablehq/stdlib": "^5.0.0" } }, "@observablehq/stdlib": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@observablehq/stdlib/-/stdlib-3.20.0.tgz", - "integrity": "sha512-7T6g2oVbwnDWDjczIryoPEULOyt+ICCLlDKyUMYRZkfdpxQp0Gvg238xTVU3z70MeXY9vNksvqdH2Lbo5jYYyA==", - "dev": true, + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/@observablehq/stdlib/-/stdlib-5.7.4.tgz", + "integrity": "sha512-JBAONxyE6K2EO5ZkpPycyImXygvpW2Z/JiYhxx5Iuox6i9emu7RzOuFsoswisLMgnlMNJo35j2py+fnfdngvZA==", "requires": { - "d3-dsv": "^2.0.0", + "d3-array": "^3.2.0", + "d3-dsv": "^3.0.1", "d3-require": "^1.3.0" + }, + "dependencies": { + "d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "requires": { + "internmap": "1 - 2" + } + } } }, "@octokit/auth-token": { @@ -30001,8 +30011,7 @@ "acorn": { "version": "8.8.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "dev": true + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==" }, "acorn-import-assertions": { "version": "1.9.0", @@ -30021,8 +30030,7 @@ "acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==" }, "add-stream": { "version": "1.0.0", @@ -31881,11 +31889,6 @@ "d3-zoom": "3" }, "dependencies": { - "commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==" - }, "d3-array": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.0.tgz", @@ -31938,16 +31941,6 @@ "d3-selection": "3" } }, - "d3-dsv": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", - "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", - "requires": { - "commander": "7", - "iconv-lite": "0.6", - "rw": "1" - } - }, "d3-ease": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", @@ -32081,14 +32074,6 @@ "d3-selection": "2 - 3", "d3-transition": "2 - 3" } - }, - "iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } } } }, @@ -32167,14 +32152,28 @@ } }, "d3-dsv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-2.0.0.tgz", - "integrity": "sha512-E+Pn8UJYx9mViuIUkoc93gJGGYut6mSDKy2+XaPwccwkRGlR+LO97L2VCCRjQivTwLHkSnAJG7yo00BWY6QM+w==", - "dev": true, + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", + "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", "requires": { - "commander": "2", - "iconv-lite": "0.4", + "commander": "7", + "iconv-lite": "0.6", "rw": "1" + }, + "dependencies": { + "commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==" + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + } } }, "d3-ease": { @@ -32312,8 +32311,7 @@ "d3-require": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/d3-require/-/d3-require-1.3.0.tgz", - "integrity": "sha512-XaNc2azaAwXhGjmCMtxlD+AowpMfLimVsAoTMpqrvb8CWoA4QqyV12mc4Ue6KSoDvfuS831tsumfhDYxGd4FGA==", - "dev": true + "integrity": "sha512-XaNc2azaAwXhGjmCMtxlD+AowpMfLimVsAoTMpqrvb8CWoA4QqyV12mc4Ue6KSoDvfuS831tsumfhDYxGd4FGA==" }, "d3-sankey": { "version": "0.12.3", @@ -35181,8 +35179,7 @@ "isoformat": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/isoformat/-/isoformat-0.2.1.tgz", - "integrity": "sha512-tFLRAygk9NqrRPhJSnNGh7g7oaVWDwR0wKh/GM2LgmPa50Eg4UfyaCO4I8k6EqJHl1/uh2RAD6g06n5ygEnrjQ==", - "dev": true + "integrity": "sha512-tFLRAygk9NqrRPhJSnNGh7g7oaVWDwR0wKh/GM2LgmPa50Eg4UfyaCO4I8k6EqJHl1/uh2RAD6g06n5ygEnrjQ==" }, "jackspeak": { "version": "2.2.1", diff --git a/packages/observable-md/README.md b/packages/observable-md/README.md index 1814463d8a..f1108c43cd 100644 --- a/packages/observable-md/README.md +++ b/packages/observable-md/README.md @@ -1,5 +1,8 @@ # @hpcc-js/observable-md +> **Warning** +> Deprectated in favor of @hpcc-js/observable-compiler + _An interpreted version of the [Observable HQ](https://observablehq.com) runtime._ * [Installing](#installing) diff --git a/packages/observable-md/package.json b/packages/observable-md/package.json index 0e4c0a29a0..d166bc1b38 100644 --- a/packages/observable-md/package.json +++ b/packages/observable-md/package.json @@ -9,8 +9,8 @@ "repl" ], "main": "dist/index.node.js", - "module": "dist/index.es6", - "module-node": "dist/index.node.es6", + "module": "dist/index.es6.js", + "module-node": "dist/index.node.es6.js", "browser": "dist/index.js", "unpkg": "dist/index.min.js", "jsdelivr": "dist/index.min.js", @@ -57,7 +57,7 @@ }, "devDependencies": { "@hpcc-js/bundle": "^2.11.3", - "@observablehq/runtime": "4.28.0", + "@observablehq/runtime": "5.7.4", "d3-require": "^1", "tslib": "2.4.1" }, @@ -72,4 +72,4 @@ "url": "https://github.com/hpcc-systems/Visualization/issues" }, "homepage": "https://github.com/hpcc-systems/Visualization" -} +} \ No newline at end of file diff --git a/packages/observable-md/rollup.config.js b/packages/observable-md/rollup.config.js index a414004e71..07a6fdb72b 100644 --- a/packages/observable-md/rollup.config.js +++ b/packages/observable-md/rollup.config.js @@ -51,7 +51,7 @@ export default [{ globals: globals, name: pkg.name }, { - file: pkg.main.split(".node.").join(".node.es6"), + file: pkg.main.split(".node.").join(".node.es6."), format: "es", sourcemap: true, globals: globals diff --git a/packages/observablehq-compiler/package.json b/packages/observablehq-compiler/package.json index 8534002335..dce971426f 100644 --- a/packages/observablehq-compiler/package.json +++ b/packages/observablehq-compiler/package.json @@ -62,7 +62,7 @@ }, "devDependencies": { "@hpcc-js/bundle": "^2.11.3", - "@observablehq/runtime": "4.28.0", + "@observablehq/runtime": "5.7.4", "tslib": "2.4.1" }, "repository": { @@ -76,4 +76,4 @@ "url": "https://github.com/hpcc-systems/Visualization/issues" }, "homepage": "https://github.com/hpcc-systems/Visualization/tree/trunk/packages/observablehq-compiler" -} +} \ No newline at end of file diff --git a/tests/test-data/src/coreTests.ts b/tests/test-data/src/coreTests.ts index 0389de72ed..d48750b9ad 100644 --- a/tests/test-data/src/coreTests.ts +++ b/tests/test-data/src/coreTests.ts @@ -23,7 +23,7 @@ export function classDef(module: string, WidgetClass: { new(): }); } -function createPlaceholder(widget: T, title: string, width: number = 640, height: number = 480, scale: number = 0.5) { +export function createPlaceholder(widget: T, title: string, width: number = 640, height: number = 480, scale: number = 0.5) { const div = document.createElement("DIV"); div.setAttribute("id", widget.classID()); div.setAttribute("class", `${widget.classID()} widgetTest`); diff --git a/tests/test-observable-md/src/index.spec.ts b/tests/test-observable-md/src/index.spec.ts deleted file mode 100644 index 58046835de..0000000000 --- a/tests/test-observable-md/src/index.spec.ts +++ /dev/null @@ -1,3 +0,0 @@ -import "es6-promise/auto"; // polyfill Promise on IE - -import "./observable.spec"; diff --git a/tests/test-observable-md/src/observable.spec.ts b/tests/test-observable-md/src/observable.spec.ts deleted file mode 100644 index c97ad37643..0000000000 --- a/tests/test-observable-md/src/observable.spec.ts +++ /dev/null @@ -1,204 +0,0 @@ -import * as omd from "@hpcc-js/observable-md"; -import { Observable, OJSRuntimeError } from "@hpcc-js/observable-md"; -import { Class, HTMLWidget, SVGWidget, Widget } from "@hpcc-js/common"; -import { expect } from "chai"; -import { classDef, renderWide } from "../../test-data/src/index"; - -const text = `\ -\`\`\` -import {checkbox, select} from "@jashkenas/inputs" - -viewof sorting = select({title: 'Sorted by', options:["region","time"], value:"time"}) -\`\`\` - -# Five-Minute Introduction - -\`\`\` -viewof colorzzz = html\`\` -html\`The color input (viewof colorzzz) is a \${viewof colorzzz.constructor.name}.\` -viewof colorzzz; -\`\`\` - -Welcome! This notebook gives a quick overview of "Observable Markdown" a mashup of the excellent [Observable HQ](https://observablehq.com) + regular Markdown. Here follows a quick introduction to Observable. For a more technical introduction, see [Observable’s not JavaScript](/@observablehq/observables-not-javascript). For hands-on, see our [introductory tutorial series](/collection/@observablehq/introduction). To watch rather than read, see our [short introductory video](https://www.youtube.com/watch?v=uEmDwflQ3xE)! - -Its also very easy to embed a value: \${i} inside the Markdown!!! - -Observable Markdown consists of a single markdown document with live "code" sections. - -\`\`\` -2 * 3 * 7 -{ -let sum = 0; -for (let i = 0; i <= 100; ++i) { - sum += i; -} -return sum; -} -\`\`\` - -Cells can have names. This allows a cell’s value to be referenced by other cells. - -\`\`\` -color = "red"; -\`My favorite color is \${color}.\` -\`\`\` - -A cell referencing another cell is re-evaluated automatically when the referenced value changes. Try editing the definition of color above and shift-return to re-evaluate. - -Cells can generate DOM (HTML, SVG, Canvas, WebGL, etc.). You can use the standard DOM API like document.createElement, or use the built-in html tagged template literal: - -\`\`\` -html\` -My favorite language is HTML. -\` -\`\`\` - -There’s a Markdown tagged template literal, too. (This notebook is written in Markdown.) - -\`\`\` -md\`My favorite language is *Markdown*.\` -\`\`\` - -DOM can be made reactive simply by referring to other cells. The next cell refers to color. (Try editing the definition of color above.) - -\`\`\` -html\`My favorite color is \${color}.\` -\`\`\` - -Sometimes you need to load data from a remote server, or compute something expensive in a web worker. For that, cells can be defined asynchronously using [promises](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises): - -\`\`\` -status = new Promise(resolve => { -setTimeout(() => { - resolve({resolved: new Date}); -}, 2000); -}) -\`\`\` - -A cell that refers to a promise cell sees the value when it is resolved; this implicit await means that referencing cells don’t care whether the value is synchronous or not. Edit the status cell above to see the cell below update after two seconds. - -\`\`\` -status -\`\`\` - -Promises are also useful for loading libraries from npm. Below, require returns a promise that resolves to the d3-fetch library: - -\`\`\` -d3 = require("d3-fetch@1") -\`\`\` - -If you prefer, you can use async and await explicitly (not this ): - -\`\`\` -countries = (await d3.tsv("https://cdn.jsdelivr.net/npm/world-atlas@1/world/110m.tsv")) - .sort((a, b) => b.pop_est - a.pop_est) // Sort by descending estimated population. - .slice(0, 10) // Take the top ten. -\`\`\` - -Cells can be defined as [generators](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generators); a value is yielded up to sixty times a second. - -\`\`\` -i = { -let i = 0; -while (true) { - yield ++i; -} -} -\`The current value of i is \${i}.\` -\`\`\` - -Any cell that refers to a generator cell sees its current value; the referencing cell is re-evaluated whenever the generator yields a new value. As you might guess, a generator can yield promises for [async iteration](https://github.com/tc39/proposal-async-iteration); referencing cells see the current resolved value. - -\`\`\` -date = { -while (true) { - yield new Promise(resolve => { - setTimeout(() => resolve(new Date), 1000); - }); -} -} -\`\`\` - -Combining these primitives—promises, generators and DOM—you can build custom user interfaces. Here’s a slider and a generator that yields the slider’s value: - -\`\`\` -slider = html\`\` -sliderValue = Generators.input(slider) -\`\`\` - -Generators.input returns a generator that yields promises. The promise resolves whenever the associated input element emits an input event. You don’t need to implement that generator by hand, though. There’s a builtin viewof operator which exposes the current value of a given input element: - -\`\`\` -viewof value = html\`\` -value -\`\`\` - -## Imports (dot) - -\`\`\` -dot\`digraph { x -> y -> z; }\`; -\`\`\` - -\`\`\` -import { dot } from "@gordonsmith/graphviz"; -\`\`\` -`; - -class ObservableEx extends Observable { - - _logErrors: OJSRuntimeError[] = []; - - constructor() { - super(); - } - - enter(domNode: HTMLElement, element: any) { - super.enter(domNode, element); - this._logErrors = []; - return this; - } - - render(callback?: (w: Widget) => void) { - super.render(w => { - setTimeout(() => { - if (callback) { - this._logErrors = [...this._logErrors, ...this.errors().filter(row => row.severity === "rejected")]; - this._logErrors.forEach(error => { - console.error(error); - }); - expect(this._logErrors.length, `${this._logErrors[0]?.message}`).to.be.equal(0); - callback(w); - } - }, 1000); - }); - return this; - } -} - -describe("@hpcc-js/observable-md", () => { - for (const key in omd) { - const item = (omd as any)[key]; - if (item && item.prototype && item.prototype.constructor) { - describe(`${item.prototype.constructor.name}`, () => { - if (item.prototype instanceof Class) { - classDef("observable-md", item); - } - if (item.prototype instanceof HTMLWidget || item.prototype instanceof SVGWidget) { - switch (item.prototype.constructor) { - case Observable: - renderWide(new ObservableEx() - .showValues(false) - .mode("omd") - .text(text)); - break; - - default: - it("Has render test", () => { - expect(false, item.prototype.constructor.name).to.be.true; - }); - } - } - }); - } - } -}); diff --git a/tests/test-observable-md/.vscode/launch.json b/tests/test-observablehq-compiler/.vscode/launch.json similarity index 83% rename from tests/test-observable-md/.vscode/launch.json rename to tests/test-observablehq-compiler/.vscode/launch.json index 9437d1fa2e..9078406533 100644 --- a/tests/test-observable-md/.vscode/launch.json +++ b/tests/test-observablehq-compiler/.vscode/launch.json @@ -30,6 +30,18 @@ "${workspaceRoot}/build/**/*" ] }, + { + "name": "Edge Debug", + "type": "msedge", + "request": "launch", + "url": "file:///${workspaceRoot}/test.html", + "trace": true, + "webRoot": "${workspaceRoot}/", + "sourceMapPathOverrides": { + "webpack:///./*": "${workspaceRoot}/*", + "webpack:///*": "/*" + } + }, { "name": "Chrome Debug", "type": "chrome", diff --git a/tests/test-observable-md/.vscode/tasks.json b/tests/test-observablehq-compiler/.vscode/tasks.json similarity index 100% rename from tests/test-observable-md/.vscode/tasks.json rename to tests/test-observablehq-compiler/.vscode/tasks.json diff --git a/tests/test-observable-md/CHANGELOG.md b/tests/test-observablehq-compiler/CHANGELOG.md similarity index 100% rename from tests/test-observable-md/CHANGELOG.md rename to tests/test-observablehq-compiler/CHANGELOG.md diff --git a/tests/test-observablehq-compiler/karma.config.js b/tests/test-observablehq-compiler/karma.config.js new file mode 100644 index 0000000000..aa70d04bb4 --- /dev/null +++ b/tests/test-observablehq-compiler/karma.config.js @@ -0,0 +1,59 @@ +/* eslint-disable no-undef */ +// Karma configuration +// Generated on Mon Apr 11 2022 12:03:14 GMT+0100 (Irish Standard Time) + +module.exports = function (config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: ".", + + // frameworks to use + // available frameworks: https://www.npmjs.com/search?q=keywords:karma-adapter + frameworks: ["mocha"], + + // list of files / patterns to load in the browser + files: [ + "lib-es6/test-observable-md/src/index.spec.js" + ], + + // list of files / patterns to exclude + exclude: [ + ], + + // preprocess matching files before serving them to the browser + // available preprocessors: https://www.npmjs.com/search?q=keywords:karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://www.npmjs.com/search?q=keywords:karma-reporter + reporters: ["progress"], + + // web server port + port: 9876, + + // enable / disable colors in the output (reporters and logs) + colors: true, + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + // start these browsers + // available browser launchers: https://www.npmjs.com/search?q=keywords:karma-launcher + browsers: ["Chrome"], + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser instances should be started simultaneously + concurrency: Infinity + }); +}; diff --git a/tests/test-observable-md/package.json b/tests/test-observablehq-compiler/package.json similarity index 84% rename from tests/test-observable-md/package.json rename to tests/test-observablehq-compiler/package.json index 02cfff1ab3..64c4c1c71e 100644 --- a/tests/test-observable-md/package.json +++ b/tests/test-observablehq-compiler/package.json @@ -1,9 +1,10 @@ { "private": true, - "name": "@hpcc-js/test-observable-md", + "name": "@hpcc-js/test-observablehq-compiler", "dependencies": { "@hpcc-js/common": "^2.71.8", - "@hpcc-js/observable-md": "^2.54.9", + "@hpcc-js/observablehq-compiler": "^1.2.6", + "@observablehq/runtime": "5.7.4", "es6-promise": "4.2.8", "simulate-event": "1.4.0" }, diff --git a/tests/test-observablehq-compiler/src/index.spec.ts b/tests/test-observablehq-compiler/src/index.spec.ts new file mode 100644 index 0000000000..39aaa96e65 --- /dev/null +++ b/tests/test-observablehq-compiler/src/index.spec.ts @@ -0,0 +1 @@ +import "./observable.spec"; diff --git a/tests/test-observablehq-compiler/src/observable.spec.ts b/tests/test-observablehq-compiler/src/observable.spec.ts new file mode 100644 index 0000000000..5c05899f3f --- /dev/null +++ b/tests/test-observablehq-compiler/src/observable.spec.ts @@ -0,0 +1,49 @@ +import { HTMLWidget } from "@hpcc-js/common"; +import { Library, Runtime, Inspector } from "@observablehq/runtime"; +import { omd2notebook, compile } from "@hpcc-js/observablehq-compiler"; +import { renderShort } from "../../test-data/src/index"; + +export const text = `\ +# Hello World!!!! + +\`\`\` +h = "Hello"; +w = "World"; +\`\`\` +--- +\`\`\` +h + " " + w + "!" +\`\`\` +`; + +class TestWidget extends HTMLWidget { + constructor(protected compiledNB: Awaited>) { + super(); + } + + enter(domNode: HTMLElement, element: any) { + super.enter(domNode, element); + + const library = new Library(); + const runtime = new Runtime(library); + this.compiledNB(runtime, name => { + const div = document.createElement("div"); + domNode.appendChild(div); + return new Inspector(div); + }); + } + + update(domNode: HTMLElement, element: any) { + super.update(domNode, element); + } +} + +describe("@hpcc-js/observable-md", () => { + + describe("OMD Render", async () => { + const ohqnb = omd2notebook(text); + const compiledNB = await compile(ohqnb); + + renderShort(new TestWidget(compiledNB)); + }); +}); diff --git a/tests/test-observable-md/test.html b/tests/test-observablehq-compiler/test.html similarity index 100% rename from tests/test-observable-md/test.html rename to tests/test-observablehq-compiler/test.html diff --git a/tests/test-observable-md/tsconfig.json b/tests/test-observablehq-compiler/tsconfig.json similarity index 93% rename from tests/test-observable-md/tsconfig.json rename to tests/test-observablehq-compiler/tsconfig.json index 4ce17c218f..b88b38c9cb 100644 --- a/tests/test-observable-md/tsconfig.json +++ b/tests/test-observablehq-compiler/tsconfig.json @@ -6,7 +6,7 @@ "sourceMap": true, "declaration": false, "moduleResolution": "node", - "noImplicitAny": true, + "noImplicitAny": false, "noEmitOnError": false, "noUnusedLocals": true, "strictNullChecks": true, diff --git a/tests/test-observable-md/webpack.config.js b/tests/test-observablehq-compiler/webpack.config.js similarity index 90% rename from tests/test-observable-md/webpack.config.js rename to tests/test-observablehq-compiler/webpack.config.js index 3ccf91eebd..0d96371e8e 100644 --- a/tests/test-observable-md/webpack.config.js +++ b/tests/test-observablehq-compiler/webpack.config.js @@ -2,7 +2,7 @@ var path = require("path"); module.exports = { - entry: "./lib-es6/test-observable-md/src/index.spec.js", + entry: "./lib-es6/test-observablehq-compiler/src/index.spec.js", output: { path: path.join(__dirname, "dist"), filename: "bundle.test.js"