diff --git a/.gitignore b/.gitignore index 6c926267..ad8d724a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,10 @@ /test-*.json /integration.json node_modules +.nyc_output +testmerge.json +.env.local* +.env.development.local* +.env.test.local* +.env.production.local* + diff --git a/package-lock.json b/package-lock.json index 5a670878..ca206dcf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,9 @@ "@typescript-eslint/parser": "^6.0.0", "chai": "^4.3.7", "eslint": "^8.40.0", + "jsdom-global": "^3.0.2", "mocha": "^10.2.0", + "npm-run-all2": "^6.0.6", "nyc": "^15.1.0", "typescript": "~5.2.0" }, @@ -204,12 +206,12 @@ }, "controller/lib/hdr-histogram-wasm": { "name": "@fs/hdr-histogram-wasm", - "version": "0.0.0", + "version": "0.6.0-scripting", "license": "Apache 2.0" }, "lib/config-wasm/pkg": { "name": "@fs/config-wasm", - "version": "0.0.0", + "version": "0.6.0-scripting", "license": "Apache 2.0" }, "node_modules/@aashutoshrathi/word-wrap": { @@ -15401,6 +15403,15 @@ "map-or-similar": "^1.5.0" } }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, "node_modules/merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -16146,6 +16157,181 @@ "node": ">=0.10.0" } }, + "node_modules/npm-run-all2": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-6.0.6.tgz", + "integrity": "sha512-Ba31DnJj3aqJ5freRdVIoBuRdGjHDt0Sfc7tduR2wYDbtcxsFlga6Sw2pE5Tn3+kdVttVwqzFlmozcT540wDxw==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "cross-spawn": "^7.0.3", + "memorystream": "^0.3.1", + "minimatch": "^9.0.0", + "pidtree": "^0.6.0", + "read-pkg": "^8.0.0", + "shell-quote": "^1.7.3" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0", + "npm": ">= 8" + } + }, + "node_modules/npm-run-all2/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/npm-run-all2/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/npm-run-all2/node_modules/hosted-git-info": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", + "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm-run-all2/node_modules/json-parse-even-better-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", + "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-run-all2/node_modules/lines-and-columns": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.3.tgz", + "integrity": "sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/npm-run-all2/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/npm-run-all2/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm-run-all2/node_modules/normalize-package-data": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.0.tgz", + "integrity": "sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==", + "dev": true, + "dependencies": { + "hosted-git-info": "^7.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm-run-all2/node_modules/parse-json": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-7.1.0.tgz", + "integrity": "sha512-ihtdrgbqdONYD156Ap6qTcaGcGdkdAxodO1wLqQ/j7HP1u2sFYppINiq4jyC8F+Nm+4fVufylCV00QmkTHkSUg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.21.4", + "error-ex": "^1.3.2", + "json-parse-even-better-errors": "^3.0.0", + "lines-and-columns": "^2.0.3", + "type-fest": "^3.8.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-all2/node_modules/parse-json/node_modules/type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-all2/node_modules/read-pkg": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-8.1.0.tgz", + "integrity": "sha512-PORM8AgzXeskHO/WEv312k9U03B8K9JSiWF/8N9sUuFjBa+9SF2u6K7VClzXwDXab51jCd8Nd36CNM+zR97ScQ==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.1", + "normalize-package-data": "^6.0.0", + "parse-json": "^7.0.0", + "type-fest": "^4.2.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-all2/node_modules/type-fest": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.3.1.tgz", + "integrity": "sha512-pphNW/msgOUSkJbH58x8sqpq8uQj6b0ZKGxEsLKMUnGorRcDjrUaLS+39+/ub41JNTwrrMyJcUB8+YZs3mbwqw==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -16949,6 +17135,18 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", @@ -18839,6 +19037,15 @@ "node": ">=8" } }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", diff --git a/package.json b/package.json index 7a17dc55..fea86c38 100644 --- a/package.json +++ b/package.json @@ -10,31 +10,39 @@ "./controller" ], "scripts": { - "start": "cd controller && next start -p 8081", - "dev": "cd controller && next dev", + "start": "npm-run-all --parallel startagent startcontroller", + "startcontroller": "cd controller && npm run start", + "startagent": "cd agent && npm run start", + "dev": "cd controller && npm run dev", "build": "npm run lint && npm run build:common && npm run build:agent && npm run build:controller", - "storybook": "cd controller && storybook dev -s ../public -p 5002", - "build-storybook": "cd controller && storybook build -s ../public", + "storybook": "cd controller && npm run storybook", + "build-storybook": "cd controller && npm run build-storybook", "lint": "node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js --fix . --ext .ts,.tsx", "linterror": "node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .ts,.tsx --max-warnings 0", - "fix:install": "rimraf \"node_modules/@types/react-native/\"", "build:common": "cd common && npm run build", "build:agent": "cd agent && npm run build", "build:controller": "cd controller && npm run build", "build:react": "cd controller && npm run build:react", - "build:test": "cd controller && npm run build:test", - "test": "npm run linterror && npm run test:common && npm run test:agent && npm run test:controller", + "build:controller:test": "cd controller && npm run build:test", + "build:test": "npm-run-all --parallel build:common build:agent build:controller:test", + "testonly:common": "cd common && npm run testonly", + "testonly:agent": "cd agent && npm run testonly", + "testonly:controller": "cd controller && npm run testonly", + "testonly": "npm-run-all --parallel testonly:common testonly:agent testonly:controller", + "testmerge": "mkdir -p .nyc_output && cp common/.nyc_output/*.json .nyc_output/ && cp agent/.nyc_output/*.json .nyc_output/ && cp controller/.nyc_output/*.json .nyc_output/ && nyc merge .nyc_output testmerge.json && nyc report --reporter=lcov --reporter=text", + "test": "npm-run-all --serial linterror build:test testonly && npm run testmerge", + "testslow": "npm run linterror && npm run test:common && npm run test:agent && npm run test:controller", "test:common": "cd common && npm run test", "test:agent": "cd agent && npm run test", "test:controller": "cd controller && npm run test", "acceptance": "npm run acceptance:agent && npm run acceptance:controller", "acceptance:agent": "cd agent && npm run acceptance", "acceptance:controller": "cd agent && npm run acceptance", - "integration": "npm run lint && npm run integration:common && npm run integration:agent && npm run integration:controller", + "integration": "npm-run-all --serial lint integration:common integration:agent integration:controller testmerge", "integration:common": "cd common && npm run integration", "integration:agent": "cd agent && npm run integration", "integration:controller": "cd controller && npm run integration", - "coverage": "npm run lint && npm run coverage:common && npm run coverage:agent && npm run coverage:controller", + "coverage": "npm-run-all --serial lint coverage:common coverage:agent coverage:controller testmerge", "coverage:common": "cd common && npm run integration", "coverage:agent": "cd agent && npm run integration", "coverage:controller": "cd controller && npm run integration", @@ -76,7 +84,9 @@ "@typescript-eslint/parser": "^6.0.0", "chai": "^4.3.7", "eslint": "^8.40.0", + "jsdom-global": "^3.0.2", "mocha": "^10.2.0", + "npm-run-all2": "^6.0.6", "nyc": "^15.1.0", "typescript": "~5.2.0" }