From a310493967cf5e3ddb2649c590d66cae54fc84ae Mon Sep 17 00:00:00 2001 From: Whathecode Date: Mon, 12 Feb 2024 19:14:59 +0100 Subject: [PATCH 1/5] Move mocha configuration to .mocharc.json `ts-node` and `jsdom` seem to be no longer needed when running mocha tests. --- build.gradle | 5 - typescript-declarations/.mocharc.json | 4 + typescript-declarations/package-lock.json | 742 +--------------------- typescript-declarations/package.json | 5 +- 4 files changed, 31 insertions(+), 725 deletions(-) create mode 100644 typescript-declarations/.mocharc.json diff --git a/build.gradle b/build.gradle index 6777fc8ed..b0547b865 100644 --- a/build.gradle +++ b/build.gradle @@ -310,11 +310,6 @@ task verifyTsDeclarations(type: NodeTask, dependsOn: compileTs) { execOverrides { it.workingDir = typescriptFolder } - args = [ - '--require', 'ts-node/register', - '--require', 'jsdom-global/register', - './tests/**/*.ts' - ] } // Add `carp.test` helpers. diff --git a/typescript-declarations/.mocharc.json b/typescript-declarations/.mocharc.json new file mode 100644 index 000000000..0d2ad4883 --- /dev/null +++ b/typescript-declarations/.mocharc.json @@ -0,0 +1,4 @@ +{ + "spec": ["tests"], + "color": true +} diff --git a/typescript-declarations/package-lock.json b/typescript-declarations/package-lock.json index 0029a7a78..564fff350 100644 --- a/typescript-declarations/package-lock.json +++ b/typescript-declarations/package-lock.json @@ -23,10 +23,7 @@ "@types/node": "20.8.7", "@typescript-eslint/typescript-estree": "5.62.0", "chai": "4.3.10", - "jsdom": "22.1.0", - "jsdom-global": "3.0.2", - "mocha": "10.2.0", - "ts-node": "10.9.1", + "mocha": "10.3.0", "typescript": "5.2.2" } }, @@ -94,43 +91,6 @@ "resolved": "carp-studies-core", "link": true }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, "node_modules/@js-joda/core": { "version": "5.6.1", "resolved": "https://registry.npmjs.org/@js-joda/core/-/core-5.6.1.tgz", @@ -171,39 +131,6 @@ "node": ">= 8" } }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true - }, "node_modules/@types/chai": { "version": "4.3.9", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.9.tgz", @@ -282,45 +209,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/abab": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", - "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", - "dev": true - }, - "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/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, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, "node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -367,12 +255,6 @@ "node": ">= 8" } }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -397,12 +279,6 @@ "node": "*" } }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -571,56 +447,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "node_modules/cssstyle": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", - "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", - "dev": true, - "dependencies": { - "rrweb-cssom": "^0.6.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/data-urls": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", - "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", - "dev": true, - "dependencies": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.0" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -650,12 +476,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/decimal.js": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", - "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "dev": true - }, "node_modules/deep-eql": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", @@ -668,15 +488,6 @@ "node": ">=6" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", @@ -698,40 +509,16 @@ "node": ">=8" } }, - "node_modules/domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "dev": true, - "dependencies": { - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "dev": true, "engines": { "node": ">=6" @@ -762,9 +549,9 @@ } }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -778,9 +565,9 @@ } }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -823,20 +610,6 @@ "flat": "cli.js" } }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -876,20 +649,19 @@ } }, "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "*" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -907,28 +679,6 @@ "node": ">= 6" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -967,61 +717,10 @@ "he": "bin/he" } }, - "node_modules/html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", - "dev": true, - "dependencies": { - "whatwg-encoding": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "dev": true, - "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "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==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, "engines": { "node": ">= 4" @@ -1103,12 +802,6 @@ "node": ">=8" } }, - "node_modules/is-potential-custom-element-name": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", - "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true - }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -1133,57 +826,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsdom": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", - "integrity": "sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==", - "dev": true, - "dependencies": { - "abab": "^2.0.6", - "cssstyle": "^3.0.0", - "data-urls": "^4.0.0", - "decimal.js": "^10.4.3", - "domexception": "^4.0.0", - "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.1", - "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.4", - "parse5": "^7.1.2", - "rrweb-cssom": "^0.6.0", - "saxes": "^6.0.0", - "symbol-tree": "^3.2.4", - "tough-cookie": "^4.1.2", - "w3c-xmlserializer": "^4.0.0", - "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.1", - "ws": "^8.13.0", - "xml-name-validator": "^4.0.0" - }, - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "canvas": "^2.5.0" - }, - "peerDependenciesMeta": { - "canvas": { - "optional": true - } - } - }, - "node_modules/jsdom-global": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jsdom-global/-/jsdom-global-3.0.2.tgz", - "integrity": "sha512-t1KMcBkz/pT5JrvcJbpUR2u/w1kO9jXctaaGJ0vZDzwFnIvGWw9IDSRciT83kIs8Bnw4qpOl8bQK08V01YgMPg==", - "dev": true, - "peerDependencies": { - "jsdom": ">=10.0.0" - } - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -1236,12 +878,6 @@ "node": ">=10" } }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -1264,27 +900,6 @@ "node": ">=8.6" } }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", @@ -1298,9 +913,9 @@ } }, "node_modules/mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", - "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.3.0.tgz", + "integrity": "sha512-uF2XJs+7xSLsrmIvn37i/wnc91nw7XjOQB8ccyx5aEgdnohr7n+rEiZP23WkCYHjilR6+EboEnbq/ZQDz4LSbg==", "dev": true, "dependencies": { "ansi-colors": "4.1.1", @@ -1310,13 +925,12 @@ "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.2.0", + "glob": "8.1.0", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "5.0.1", "ms": "2.1.3", - "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", @@ -1331,10 +945,6 @@ }, "engines": { "node": ">= 14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" } }, "node_modules/mocha/node_modules/ms": { @@ -1349,18 +959,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -1370,12 +968,6 @@ "node": ">=0.10.0" } }, - "node_modules/nwsapi": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", - "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", - "dev": true - }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1415,18 +1007,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", - "dev": true, - "dependencies": { - "entities": "^4.4.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -1436,15 +1016,6 @@ "node": ">=8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -1475,27 +1046,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true - }, - "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -1546,12 +1096,6 @@ "node": ">=0.10.0" } }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true - }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -1562,12 +1106,6 @@ "node": ">=0.10.0" } }, - "node_modules/rrweb-cssom": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", - "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", - "dev": true - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -1611,28 +1149,10 @@ } ] }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "node_modules/saxes": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", - "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", - "dev": true, - "dependencies": { - "xmlchars": "^2.2.0" - }, - "engines": { - "node": ">=v12.22.7" - } - }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1715,12 +1235,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -1733,85 +1247,6 @@ "node": ">=8.0" } }, - "node_modules/tough-cookie": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", - "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", - "dev": true, - "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tr46": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", - "dev": true, - "dependencies": { - "punycode": "^2.3.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, - "node_modules/ts-node/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", @@ -1861,86 +1296,6 @@ "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==", "dev": true }, - "node_modules/universalify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/url-parse": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dev": true, - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true - }, - "node_modules/w3c-xmlserializer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", - "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", - "dev": true, - "dependencies": { - "xml-name-validator": "^4.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/whatwg-encoding": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", - "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", - "dev": true, - "dependencies": { - "iconv-lite": "0.6.3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/whatwg-url": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", - "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", - "dev": true, - "dependencies": { - "tr46": "^4.1.1", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", @@ -1970,42 +1325,6 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, - "node_modules/ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -2063,15 +1382,6 @@ "node": ">=10" } }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/typescript-declarations/package.json b/typescript-declarations/package.json index 4a82ac510..4eb76c464 100644 --- a/typescript-declarations/package.json +++ b/typescript-declarations/package.json @@ -19,12 +19,9 @@ "@types/node": "20.8.7", "chai": "4.3.10", "@types/chai": "4.3.9", - "mocha": "10.2.0", + "mocha": "10.3.0", "@types/mocha": "10.0.3", "@typescript-eslint/typescript-estree": "5.62.0", - "jsdom": "22.1.0", - "jsdom-global": "3.0.2", - "ts-node": "10.9.1", "typescript": "5.2.2" } } From 2bb0a80e5d84edcc63595dc2159a89b040c1210c Mon Sep 17 00:00:00 2001 From: Whathecode Date: Mon, 12 Feb 2024 22:17:08 +0100 Subject: [PATCH 2/5] Upgrade to JS nodenext module system Also updated other JS/TS dependencies. Primarily, updating to nodenext also allowed to finally upgrade `@typescript-eslint/typescript-estree`, which depended on this module system. --- typescript-declarations/package-lock.json | 115 ++++++++++-------- typescript-declarations/package.json | 10 +- typescript-declarations/tests/VerifyModule.ts | 8 +- typescript-declarations/tsconfig.json | 3 +- 4 files changed, 72 insertions(+), 64 deletions(-) diff --git a/typescript-declarations/package-lock.json b/typescript-declarations/package-lock.json index 564fff350..ad4f9c16f 100644 --- a/typescript-declarations/package-lock.json +++ b/typescript-declarations/package-lock.json @@ -18,13 +18,13 @@ "@js-joda/core": "5.6.1" }, "devDependencies": { - "@types/chai": "4.3.9", - "@types/mocha": "10.0.3", - "@types/node": "20.8.7", - "@typescript-eslint/typescript-estree": "5.62.0", + "@types/chai": "4.3.11", + "@types/mocha": "10.0.6", + "@types/node": "20.11.17", + "@typescript-eslint/typescript-estree": "7.0.1", "chai": "4.3.10", "mocha": "10.3.0", - "typescript": "5.2.2" + "typescript": "5.3.3" } }, "carp-common": { @@ -132,33 +132,33 @@ } }, "node_modules/@types/chai": { - "version": "4.3.9", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.9.tgz", - "integrity": "sha512-69TtiDzu0bcmKQv3yg1Zx409/Kd7r0b5F1PfpYJfSHzLGtB53547V4u+9iqKYsTu/O2ai6KTb0TInNpvuQ3qmg==", + "version": "4.3.11", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.11.tgz", + "integrity": "sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ==", "dev": true }, "node_modules/@types/mocha": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.3.tgz", - "integrity": "sha512-RsOPImTriV/OE4A9qKjMtk2MnXiuLLbcO3nCXK+kvq4nr0iMfFgpjaX3MPLb6f7+EL1FGSelYvuJMV6REH+ZPQ==", + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", + "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==", "dev": true }, "node_modules/@types/node": { - "version": "20.8.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.7.tgz", - "integrity": "sha512-21TKHHh3eUHIi2MloeptJWALuCu5H7HQTdTrWIFReA8ad+aggoX+lRes3ex7/FtpC+sVUpFMQ+QTfYr74mruiQ==", + "version": "20.11.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.17.tgz", + "integrity": "sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==", "dev": true, "dependencies": { - "undici-types": "~5.25.1" + "undici-types": "~5.26.4" } }, "node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.0.1.tgz", + "integrity": "sha512-uJDfmirz4FHib6ENju/7cz9SdMSkeVvJDK3VcMFvf/hAShg8C74FW+06MaQPODHfDJp/z/zHfgawIJRjlu0RLg==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -166,21 +166,22 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.0.1.tgz", + "integrity": "sha512-SO9wHb6ph0/FN5OJxH4MiPscGah5wjOd0RRpaLvuBv9g8565Fgu0uMySFEPqwPHiQU90yzJ2FjRYKGrAhS1xig==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", + "@typescript-eslint/types": "7.0.1", + "@typescript-eslint/visitor-keys": "7.0.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -192,17 +193,32 @@ } } }, + "node_modules/@typescript-eslint/typescript-estree/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/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.0.1.tgz", + "integrity": "sha512-hwAgrOyk++RTXrP4KzCg7zB2U0xt7RUU0ZdMSCsqF3eKUwkdXUMyTb0qdCuji7VIbcpG62kKTU9M1J1c9UpFBw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "7.0.1", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -1247,25 +1263,16 @@ "node": ">=8.0" } }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "node_modules/ts-api-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.2.1.tgz", + "integrity": "sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==", "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, "engines": { - "node": ">= 6" + "node": ">=16" }, "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "typescript": ">=4.2.0" } }, "node_modules/type-detect": { @@ -1278,9 +1285,9 @@ } }, "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -1291,9 +1298,9 @@ } }, "node_modules/undici-types": { - "version": "5.25.3", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", - "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==", + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true }, "node_modules/workerpool": { diff --git a/typescript-declarations/package.json b/typescript-declarations/package.json index 4eb76c464..a0d359897 100644 --- a/typescript-declarations/package.json +++ b/typescript-declarations/package.json @@ -16,12 +16,12 @@ "@js-joda/core": "5.6.1" }, "devDependencies": { - "@types/node": "20.8.7", + "@types/node": "20.11.17", "chai": "4.3.10", - "@types/chai": "4.3.9", + "@types/chai": "4.3.11", "mocha": "10.3.0", - "@types/mocha": "10.0.3", - "@typescript-eslint/typescript-estree": "5.62.0", - "typescript": "5.2.2" + "@types/mocha": "10.0.6", + "@typescript-eslint/typescript-estree": "7.0.1", + "typescript": "5.3.3" } } diff --git a/typescript-declarations/tests/VerifyModule.ts b/typescript-declarations/tests/VerifyModule.ts index bf5bb4e1f..737dd7609 100644 --- a/typescript-declarations/tests/VerifyModule.ts +++ b/typescript-declarations/tests/VerifyModule.ts @@ -7,11 +7,12 @@ import { import ClassBody = TSESTree.ClassBody import ClassElement = TSESTree.ClassElement import Identifier = TSESTree.Identifier -import Literal = TSESTree.Literal +import StringLiteral = TSESTree.StringLiteral import ProgramStatement = TSESTree.ProgramStatement import TSModuleBlock = TSESTree.TSModuleBlock import TSModuleDeclaration = TSESTree.TSModuleDeclaration import TSInterfaceBody = TSESTree.TSInterfaceBody +import TSQualifiedName = TSESTree.TSQualifiedName import TypeElement = TSESTree.TypeElement import * as fs from 'fs' @@ -37,7 +38,8 @@ export default class VerifyModule const source = fs.readFileSync( this.declarationFile ).toString() const ast = parse( source ) - const scope = await Promise.resolve( import( this.moduleName ) ) + const module = await Promise.resolve( import( this.moduleName ) ) + const scope = module.default for ( const statement of ast.body ) { this.verifyStatement( statement, scope ) @@ -174,7 +176,7 @@ export default class VerifyModule } } - verifyIdentifier( id: Identifier | Literal | null, scope: any ): any + verifyIdentifier( id: Identifier | StringLiteral | TSQualifiedName | null, scope: any ): any { if ( id?.type != AST_NODE_TYPES.Identifier ) return scope diff --git a/typescript-declarations/tsconfig.json b/typescript-declarations/tsconfig.json index 441d734b2..3a6f56b53 100644 --- a/typescript-declarations/tsconfig.json +++ b/typescript-declarations/tsconfig.json @@ -1,8 +1,7 @@ { "compilerOptions": { "target": "ES6", - "module": "UMD", - "moduleResolution": "node", + "module": "nodenext", "sourceMap": true, "strict": true } From 841123a2c5a235687d3eeb56f6d043cb10f718fe Mon Sep 17 00:00:00 2001 From: Whathecode Date: Sat, 17 Feb 2024 18:37:02 +0100 Subject: [PATCH 3/5] Add package.json to JS test output Later more strict JS module systems require package.json to be present. --- build.gradle | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index b0547b865..f47f96d2c 100644 --- a/build.gradle +++ b/build.gradle @@ -31,7 +31,9 @@ buildscript { commonModule = subprojects.find { it.name == 'carp.common' } coreModules = subprojects.findAll { it.name.endsWith( '.core' ) } + testModules = subprojects.findAll { it.name == 'carp.common.test' || it.name == 'carp.test' } publishNpmModule = subprojects.find { it.name == 'publish-npm-packages' } + allModules = coreModules + testModules + commonModule + publishNpmModule devOpsModules = subprojects.findAll {it.name == 'carp.detekt' || it.name == 'rpc' } + publishNpmModule } @@ -234,6 +236,7 @@ task setSnapshotVersion { // TypeScript ambient declaration verification. def typescriptFolder = 'typescript-declarations' +def npmScope = "@cachet" apply plugin: 'com.github.node-gradle.node' task setupTsProject(type: NpmTask) { workingDir = file(typescriptFolder) @@ -241,8 +244,7 @@ task setupTsProject(type: NpmTask) { } task copyTestJsSources(type: Copy, dependsOn: setupTsProject) { // Compile production sources for CARP, and the JS publication project (`publishNpmModule`). - def projects = coreModules + commonModule + publishNpmModule - projects.each { + allModules.each { def project = it.name dependsOn("$project:jsProductionExecutableCompileSync") } @@ -258,7 +260,7 @@ task copyTestJsSources(type: Copy, dependsOn: setupTsProject) { } eachFile { file -> // Compiled sources have the name of the module they represent, followed by ".js" and ".d.ts". - // To be recognized by node, place them as "index.js" and "index.d.ts" in "node_modules/@cachet/". + // To be recognized by node, place them as "index.js" and "index.d.ts" in "node_modules//". def fileMatch = file.name =~ /(.+)\.(js|d\.ts)/ def moduleName = fileMatch[0][1] def extension = fileMatch[0][2] @@ -273,8 +275,8 @@ task copyTestJsSources(type: Copy, dependsOn: setupTsProject) { // Modify sources to act like modules with exported named members. file.filter { line -> // Compiled sources refer to other modules as adjacent .js source files. - // Change these to the named modules created in the previous step. - def namedModules = line.replaceAll(~/'\.\/(.+?)\.js'/, "'@cachet/\$1'") + // Change these to the scoped modules created in the previous step. + def namedModules = line.replaceAll(~/'\.\/(.+?)\.js'/, "'$npmScope/\$1'") // Replace `any` types with actual types for which facades are specified. def replacedTypes = knownFacadeTypes.inject(namedModules) { curLine, type -> @@ -299,9 +301,33 @@ task copyTestJsSources(type: Copy, dependsOn: setupTsProject) { additionalExports } } - into "./$typescriptFolder/node_modules/@cachet/" + into "./$typescriptFolder/node_modules/$npmScope/" } -task compileTs(type: NpmTask, dependsOn: copyTestJsSources) { +task packageTestJsSources(type: Copy, dependsOn: copyTestJsSources) { + allModules.each { + def project = it.name + dependsOn("$project:jsPackageJson") + dependsOn("$project:jsTestPackageJson") + } + + from("$rootDir/build/js/packages") { + include "**/package.json" + includeEmptyDirs = false + } + eachFile { file -> + def moduleName = file.getFile().getParentFile().name + file.filter { line -> + // Add scope to module name. + def changedName = line.replaceAll(~/("name": ).*/, "\$1 \"$npmScope/$moduleName\",") + + // Point main source to 'index.js'. + changedName.replaceAll(~/("main": ).*/, "\$1 \"index.js\",") + } + + } + into "./$typescriptFolder/node_modules/$npmScope/" +} +task compileTs(type: NpmTask, dependsOn: packageTestJsSources) { workingDir = file(typescriptFolder) args = ['run', 'tsc'] } From 2d229523a192ee7eb8f1f3e2db14bb657a4ba49f Mon Sep 17 00:00:00 2001 From: Whathecode Date: Mon, 12 Feb 2024 23:28:43 +0100 Subject: [PATCH 4/5] Make TS wrappers and tests ES modules --- typescript-declarations/carp-common/index.ts | 26 ++++----- .../carp-common/package.json | 2 + .../carp-data-core/index.ts | 2 +- .../carp-data-core/package.json | 2 + .../carp-deployments-core/index.ts | 28 +++++----- .../carp-deployments-core/package.json | 2 + typescript-declarations/carp-kotlin/index.ts | 54 +++++++++---------- .../carp-kotlin/package.json | 2 + .../carp-kotlinx-datetime/index.ts | 6 +-- .../carp-kotlinx-datetime/package.json | 2 + .../carp-kotlinx-serialization/index.ts | 8 +-- .../carp-kotlinx-serialization/package.json | 2 + .../carp-protocols-core/index.ts | 28 +++++----- .../carp-protocols-core/package.json | 2 + .../carp-studies-core/index.ts | 32 +++++------ .../carp-studies-core/package.json | 2 + typescript-declarations/package.json | 1 + .../tests/carp-common-test.ts | 7 +-- .../tests/carp-deployments-test.ts | 13 ++--- .../tests/carp-kotlin-test.ts | 4 +- .../tests/carp-kotlinx-datetime-test.ts | 6 +-- .../tests/carp-kotlinx-serialization-test.ts | 4 +- .../tests/carp-protocols-test.ts | 23 ++++---- .../tests/carp-studies-test.ts | 9 ++-- 24 files changed, 145 insertions(+), 122 deletions(-) diff --git a/typescript-declarations/carp-common/index.ts b/typescript-declarations/carp-common/index.ts index 9c1a7b107..ec2b04cce 100644 --- a/typescript-declarations/carp-common/index.ts +++ b/typescript-declarations/carp-common/index.ts @@ -1,7 +1,7 @@ -import * as extend from "@cachet/carp-common-generated" -import * as kotlinStdLib from "@cachet/carp-kotlin" -import * as kotlinDateTime from "@cachet/carp-kotlinx-datetime" -import * as kotlinSerialization from "@cachet/carp-kotlinx-serialization" +import extend from "@cachet/carp-common-generated" +import kotlinStdLib from "@cachet/carp-kotlin" +import kotlinDateTime from "@cachet/carp-kotlinx-datetime" +import kotlinSerialization from "@cachet/carp-kotlinx-serialization" declare module "@cachet/carp-common-generated" @@ -9,7 +9,7 @@ declare module "@cachet/carp-common-generated" // Declare missing types for which no imports were generated. namespace kotlin { - type Long = kotlinStdLib.kotlin.Long + type Long = kotlinStdLib.Long } namespace kotlin.reflect { @@ -19,24 +19,24 @@ declare module "@cachet/carp-common-generated" } namespace kotlin.time { - type Duration = kotlinStdLib.kotlin.time.Duration + type Duration = kotlinStdLib.time.Duration } namespace kotlin.collections { - type List = kotlinStdLib.kotlin.collections.List - type Set = kotlinStdLib.kotlin.collections.Set - type Map = kotlinStdLib.kotlin.collections.Map + type List = kotlinStdLib.collections.List + type Set = kotlinStdLib.collections.Set + type Map = kotlinStdLib.collections.Map } namespace kotlinx.datetime { - type Instant = kotlinDateTime.kotlinx.datetime.Instant + type Instant = kotlinDateTime.datetime.Instant } namespace kotlinx.serialization.json { - type Json = kotlinSerialization.kotlinx.serialization.json.Json + type Json = kotlinSerialization.serialization.json.Json } } -// Export facade. -export * from "@cachet/carp-common-generated" +// Re-export augmented types. +export { default } from "@cachet/carp-common-generated" diff --git a/typescript-declarations/carp-common/package.json b/typescript-declarations/carp-common/package.json index d7b03783e..077068ff9 100644 --- a/typescript-declarations/carp-common/package.json +++ b/typescript-declarations/carp-common/package.json @@ -1,4 +1,6 @@ { "name": "@cachet/carp-common", + "type": "module", + "main": "index.js", "version": "1.1.2" } diff --git a/typescript-declarations/carp-data-core/index.ts b/typescript-declarations/carp-data-core/index.ts index 2ce2186f6..306442024 100644 --- a/typescript-declarations/carp-data-core/index.ts +++ b/typescript-declarations/carp-data-core/index.ts @@ -2,7 +2,7 @@ import * as extend from "@cachet/carp-data-core-generated" import * as kotlinStdLib from "@cachet/carp-kotlin" import * as kotlinDateTime from "@cachet/carp-kotlinx-datetime" import * as kotlinSerialization from "@cachet/carp-kotlinx-serialization" -import * as carpCommon from "@cachet/carp-common" +import carpCommon from "@cachet/carp-common" declare module "@cachet/carp-data-core-generated" diff --git a/typescript-declarations/carp-data-core/package.json b/typescript-declarations/carp-data-core/package.json index e58be6f19..5ad62dc2d 100644 --- a/typescript-declarations/carp-data-core/package.json +++ b/typescript-declarations/carp-data-core/package.json @@ -1,4 +1,6 @@ { "name": "@cachet/carp-data-core", + "type": "module", + "main": "index.js", "version": "1.1.2" } diff --git a/typescript-declarations/carp-deployments-core/index.ts b/typescript-declarations/carp-deployments-core/index.ts index 5a0aff641..bc72ea873 100644 --- a/typescript-declarations/carp-deployments-core/index.ts +++ b/typescript-declarations/carp-deployments-core/index.ts @@ -1,8 +1,8 @@ -import * as extend from "@cachet/carp-deployments-core-generated" -import * as kotlinStdLib from "@cachet/carp-kotlin" -import * as kotlinDateTime from "@cachet/carp-kotlinx-datetime" -import * as kotlinSerialization from "@cachet/carp-kotlinx-serialization" -import * as carpCommon from "@cachet/carp-common" +import extend from "@cachet/carp-deployments-core-generated" +import kotlinStdLib from "@cachet/carp-kotlin" +import kotlinDateTime from "@cachet/carp-kotlinx-datetime" +import kotlinSerialization from "@cachet/carp-kotlinx-serialization" +import carpCommon from "@cachet/carp-common" declare module "@cachet/carp-deployments-core-generated" @@ -10,7 +10,7 @@ declare module "@cachet/carp-deployments-core-generated" // Declare missing types for which no imports were generated. namespace kotlin { - type Long = kotlinStdLib.kotlin.Long + type Long = kotlinStdLib.Long } namespace kotlin.reflect { @@ -20,21 +20,21 @@ declare module "@cachet/carp-deployments-core-generated" } namespace kotlin.time { - type Duration = kotlinStdLib.kotlin.time.Duration + type Duration = kotlinStdLib.time.Duration } namespace kotlin.collections { - type List = kotlinStdLib.kotlin.collections.List - type Set = kotlinStdLib.kotlin.collections.Set - type Map = kotlinStdLib.kotlin.collections.Map + type List = kotlinStdLib.collections.List + type Set = kotlinStdLib.collections.Set + type Map = kotlinStdLib.collections.Map } namespace kotlinx.datetime { - type Instant = kotlinDateTime.kotlinx.datetime.Instant + type Instant = kotlinDateTime.datetime.Instant } namespace kotlinx.serialization.json { - type Json = kotlinSerialization.kotlinx.serialization.json.Json + type Json = kotlinSerialization.serialization.json.Json } } @@ -43,5 +43,5 @@ declare module "@cachet/carp-deployments-core-generated" extend.dk.cachet.carp.common = carpCommon.dk.cachet.carp.common as any; -// Export facade. -export * from "@cachet/carp-deployments-core-generated" +// Re-export augmented types. +export { default } from "@cachet/carp-deployments-core-generated" diff --git a/typescript-declarations/carp-deployments-core/package.json b/typescript-declarations/carp-deployments-core/package.json index 78ce43d76..4eb5424fb 100644 --- a/typescript-declarations/carp-deployments-core/package.json +++ b/typescript-declarations/carp-deployments-core/package.json @@ -1,4 +1,6 @@ { "name": "@cachet/carp-deployments-core", + "type": "module", + "main": "index.js", "version": "1.1.2" } diff --git a/typescript-declarations/carp-kotlin/index.ts b/typescript-declarations/carp-kotlin/index.ts index ff6b1007f..b7a61db40 100644 --- a/typescript-declarations/carp-kotlin/index.ts +++ b/typescript-declarations/carp-kotlin/index.ts @@ -1,4 +1,4 @@ -import * as kotlinStdLib from "@cachet/kotlin-kotlin-stdlib" +import extend from "@cachet/kotlin-kotlin-stdlib" // Facade with better method names and type conversions for internal types. @@ -9,11 +9,11 @@ export namespace kotlin { toNumber(): number } - export const toLong: (number: number) => Long = kotlinStdLib.$_$.toLong_0 + export const toLong: (number: number) => Long = extend.$_$.toLong_0 export class Pair { constructor( first: K, second: V ) { - let kotlinPair = new kotlinStdLib.$_$.Pair( first, second ); + let kotlinPair = new extend.$_$.Pair( first, second ); kotlinPair.first = kotlinPair.md_1; kotlinPair.second = kotlinPair.nd_1; return kotlinPair; @@ -38,12 +38,12 @@ export namespace kotlin.collections keys: Set values: Collection } - export const listOf: (array: T[]) => List = kotlinStdLib.$_$.listOf_0 - export const setOf: (array: T[]) => Set = kotlinStdLib.$_$.setOf_0 + export const listOf: (array: T[]) => List = extend.$_$.listOf_0 + export const setOf: (array: T[]) => Set = extend.$_$.setOf_0 export const mapOf = function( pairs: kotlin.Pair[] ): Map { - return kotlinStdLib.$_$.mapOf_0( pairs as any ) + return extend.$_$.mapOf_0( pairs as any ) } } export namespace kotlin.time @@ -55,7 +55,7 @@ export namespace kotlin.time } export namespace Duration { - export const Companion: any = kotlinStdLib.$_$.Companion_getInstance_13() + export const Companion: any = extend.$_$.Companion_getInstance_13() export const parseIsoString: (isoDuration: string) => Duration = Companion.zf export const ZERO: Duration = Companion.wf_1 export const INFINITE: Duration = Companion.xf_1 @@ -97,37 +97,37 @@ declare module "@cachet/kotlin-kotlin-stdlib" // Implement base interfaces in internal types. -kotlinStdLib.$_$.Long.prototype.toNumber = function(): number { return this.da(); }; -Object.defineProperty( kotlinStdLib.$_$.Long.prototype, "inWholeMilliseconds", { +extend.$_$.Long.prototype.toNumber = function(): number { return this.da(); }; +Object.defineProperty( extend.$_$.Long.prototype, "inWholeMilliseconds", { get: function inWholeMilliseconds() { - return kotlinStdLib.$_$._Duration___get_inWholeMilliseconds__impl__msfiry(this).toNumber(); + return extend.$_$._Duration___get_inWholeMilliseconds__impl__msfiry(this).toNumber(); } } ); -Object.defineProperty( kotlinStdLib.$_$.Long.prototype, "inWholeMicroseconds", { +Object.defineProperty( extend.$_$.Long.prototype, "inWholeMicroseconds", { get: function inWholeMicroseconds() { - return kotlinStdLib.$_$._Duration___get_inWholeMicroseconds__impl__8oe8vv(this).toNumber(); + return extend.$_$._Duration___get_inWholeMicroseconds__impl__8oe8vv(this).toNumber(); } } ); -kotlinStdLib.$_$.EmptyList.prototype.contains = function( value: T ): boolean { return false; } -kotlinStdLib.$_$.EmptyList.prototype.size = function(): number { return 0; } -kotlinStdLib.$_$.EmptyList.prototype.toArray = function(): T[] { return []; } -kotlinStdLib.$_$.AbstractMutableList.prototype.contains = function( value: T ): boolean { return this.p( value ); } -kotlinStdLib.$_$.AbstractMutableList.prototype.size = function(): number { return this.n(); } -kotlinStdLib.$_$.EmptySet.prototype.contains = function( value: T ): boolean { return false; } -kotlinStdLib.$_$.EmptySet.prototype.size = function(): number { return 0; } -kotlinStdLib.$_$.EmptySet.prototype.toArray = function(): T[] { return []; } -kotlinStdLib.$_$.HashSet.prototype.contains = function( value: T ): boolean { return this.p( value ); } -kotlinStdLib.$_$.HashSet.prototype.size = function(): number { return this.n(); } -kotlinStdLib.$_$.HashMap.prototype.get = function( key: K ): V { return this.x2( key ); } -Object.defineProperty( kotlinStdLib.$_$.HashMap.prototype, "keys", { +extend.$_$.EmptyList.prototype.contains = function( value: T ): boolean { return false; } +extend.$_$.EmptyList.prototype.size = function(): number { return 0; } +extend.$_$.EmptyList.prototype.toArray = function(): T[] { return []; } +extend.$_$.AbstractMutableList.prototype.contains = function( value: T ): boolean { return this.p( value ); } +extend.$_$.AbstractMutableList.prototype.size = function(): number { return this.n(); } +extend.$_$.EmptySet.prototype.contains = function( value: T ): boolean { return false; } +extend.$_$.EmptySet.prototype.size = function(): number { return 0; } +extend.$_$.EmptySet.prototype.toArray = function(): T[] { return []; } +extend.$_$.HashSet.prototype.contains = function( value: T ): boolean { return this.p( value ); } +extend.$_$.HashSet.prototype.size = function(): number { return this.n(); } +extend.$_$.HashMap.prototype.get = function( key: K ): V { return this.x2( key ); } +Object.defineProperty( extend.$_$.HashMap.prototype, "keys", { get: function keys() { return this.l2(); } } ); -Object.defineProperty( kotlinStdLib.$_$.HashMap.prototype, "values", { +Object.defineProperty( extend.$_$.HashMap.prototype, "values", { get: function values() { return this.m2(); } } ); -// Re-export augmented types. -export * from "@cachet/kotlin-kotlin-stdlib"; +// Export facade. +export default kotlin diff --git a/typescript-declarations/carp-kotlin/package.json b/typescript-declarations/carp-kotlin/package.json index bd0b4af7c..d11440975 100644 --- a/typescript-declarations/carp-kotlin/package.json +++ b/typescript-declarations/carp-kotlin/package.json @@ -1,4 +1,6 @@ { "name": "@cachet/carp-kotlin", + "type": "module", + "main": "index.js", "version": "1.1.2" } diff --git a/typescript-declarations/carp-kotlinx-datetime/index.ts b/typescript-declarations/carp-kotlinx-datetime/index.ts index 9a13608fe..cfc51a4fa 100644 --- a/typescript-declarations/carp-kotlinx-datetime/index.ts +++ b/typescript-declarations/carp-kotlinx-datetime/index.ts @@ -1,4 +1,4 @@ -import * as extend from "@cachet/Kotlin-DateTime-library-kotlinx-datetime-js-ir" +import extend from "@cachet/Kotlin-DateTime-library-kotlinx-datetime-js-ir" // Facade with better method names and type conversions for internal types. @@ -37,5 +37,5 @@ extend.$_$.System.prototype.now = function(): kotlinx.datetime.Instant { return extend.$_$.Instant_0.prototype.toEpochMilliseconds = function(): number { return this.y1e(); }; -// Re-export augmented types. -export * from "@cachet/Kotlin-DateTime-library-kotlinx-datetime-js-ir" +// Export facade. +export default kotlinx diff --git a/typescript-declarations/carp-kotlinx-datetime/package.json b/typescript-declarations/carp-kotlinx-datetime/package.json index 687b8db7e..e8e008959 100644 --- a/typescript-declarations/carp-kotlinx-datetime/package.json +++ b/typescript-declarations/carp-kotlinx-datetime/package.json @@ -1,4 +1,6 @@ { "name": "@cachet/carp-kotlinx-datetime", + "type": "module", + "main": "index.js", "version": "1.1.2" } diff --git a/typescript-declarations/carp-kotlinx-serialization/index.ts b/typescript-declarations/carp-kotlinx-serialization/index.ts index dbbdf0f05..d585a171d 100644 --- a/typescript-declarations/carp-kotlinx-serialization/index.ts +++ b/typescript-declarations/carp-kotlinx-serialization/index.ts @@ -1,5 +1,5 @@ -import * as extendCore from "@cachet/kotlinx-serialization-kotlinx-serialization-core" -import * as extendJson from "@cachet/kotlinx-serialization-kotlinx-serialization-json" +import extendCore from "@cachet/kotlinx-serialization-kotlinx-serialization-core" +import extendJson from "@cachet/kotlinx-serialization-kotlinx-serialization-json" // Facade with better method names and type conversions for internal types. @@ -51,5 +51,5 @@ extendJson.$_$.JsonImpl.prototype.decodeFromString = }; -// Re-export augmented types. -export * from "@cachet/kotlinx-serialization-kotlinx-serialization-json" +// Export facade. +export default kotlinx diff --git a/typescript-declarations/carp-kotlinx-serialization/package.json b/typescript-declarations/carp-kotlinx-serialization/package.json index 5c648899a..f13aefbc3 100644 --- a/typescript-declarations/carp-kotlinx-serialization/package.json +++ b/typescript-declarations/carp-kotlinx-serialization/package.json @@ -1,4 +1,6 @@ { "name": "@cachet/carp-kotlinx-serialization", + "type": "module", + "main": "index.js", "version": "1.1.2" } diff --git a/typescript-declarations/carp-protocols-core/index.ts b/typescript-declarations/carp-protocols-core/index.ts index 0a1ae2bbb..3a7062c77 100644 --- a/typescript-declarations/carp-protocols-core/index.ts +++ b/typescript-declarations/carp-protocols-core/index.ts @@ -1,8 +1,8 @@ -import * as extend from "@cachet/carp-protocols-core-generated" -import * as kotlinStdLib from "@cachet/carp-kotlin" -import * as kotlinDateTime from "@cachet/carp-kotlinx-datetime" -import * as kotlinSerialization from "@cachet/carp-kotlinx-serialization" -import * as carpCommon from "@cachet/carp-common" +import extend from "@cachet/carp-protocols-core-generated" +import kotlinStdLib from "@cachet/carp-kotlin" +import kotlinDateTime from "@cachet/carp-kotlinx-datetime" +import kotlinSerialization from "@cachet/carp-kotlinx-serialization" +import carpCommon from "@cachet/carp-common" declare module "@cachet/carp-protocols-core-generated" @@ -10,7 +10,7 @@ declare module "@cachet/carp-protocols-core-generated" // Declare missing types for which no imports were generated. namespace kotlin { - type Long = kotlinStdLib.kotlin.Long + type Long = kotlinStdLib.Long } namespace kotlin.reflect { @@ -20,21 +20,21 @@ declare module "@cachet/carp-protocols-core-generated" } namespace kotlin.time { - type Duration = kotlinStdLib.kotlin.time.Duration + type Duration = kotlinStdLib.time.Duration } namespace kotlin.collections { - type List = kotlinStdLib.kotlin.collections.List - type Set = kotlinStdLib.kotlin.collections.Set - type Map = kotlinStdLib.kotlin.collections.Map + type List = kotlinStdLib.collections.List + type Set = kotlinStdLib.collections.Set + type Map = kotlinStdLib.collections.Map } namespace kotlinx.datetime { - type Instant = kotlinDateTime.kotlinx.datetime.Instant + type Instant = kotlinDateTime.datetime.Instant } namespace kotlinx.serialization.json { - type Json = kotlinSerialization.kotlinx.serialization.json.Json + type Json = kotlinSerialization.serialization.json.Json } } @@ -43,5 +43,5 @@ declare module "@cachet/carp-protocols-core-generated" extend.dk.cachet.carp.common = carpCommon.dk.cachet.carp.common as any; -// Export facade. -export * from "@cachet/carp-protocols-core-generated" +// Re-export augmented types. +export { default } from "@cachet/carp-protocols-core-generated" diff --git a/typescript-declarations/carp-protocols-core/package.json b/typescript-declarations/carp-protocols-core/package.json index a10f088d5..83595db01 100644 --- a/typescript-declarations/carp-protocols-core/package.json +++ b/typescript-declarations/carp-protocols-core/package.json @@ -1,4 +1,6 @@ { "name": "@cachet/carp-protocols-core", + "type": "module", + "main": "index.js", "version": "1.1.2" } diff --git a/typescript-declarations/carp-studies-core/index.ts b/typescript-declarations/carp-studies-core/index.ts index 0e5dd1e8e..820d8b2e4 100644 --- a/typescript-declarations/carp-studies-core/index.ts +++ b/typescript-declarations/carp-studies-core/index.ts @@ -1,9 +1,9 @@ -import * as extend from "@cachet/carp-studies-core-generated" -import * as kotlinStdLib from "@cachet/carp-kotlin" -import * as kotlinDateTime from "@cachet/carp-kotlinx-datetime" -import * as kotlinSerialization from "@cachet/carp-kotlinx-serialization" -import * as carpCommon from "@cachet/carp-common" -import * as carpDeployments from "@cachet/carp-deployments-core" +import extend from "@cachet/carp-studies-core-generated" +import kotlinStdLib from "@cachet/carp-kotlin" +import kotlinDateTime from "@cachet/carp-kotlinx-datetime" +import kotlinSerialization from "@cachet/carp-kotlinx-serialization" +import carpCommon from "@cachet/carp-common" +import carpDeployments from "@cachet/carp-deployments-core" declare module "@cachet/carp-studies-core-generated" @@ -11,7 +11,7 @@ declare module "@cachet/carp-studies-core-generated" // Declare missing types for which no imports were generated. namespace kotlin { - type Long = kotlinStdLib.kotlin.Long + type Long = kotlinStdLib.Long } namespace kotlin.reflect { @@ -21,22 +21,22 @@ declare module "@cachet/carp-studies-core-generated" } namespace kotlin.time { - type Duration = kotlinStdLib.kotlin.time.Duration + type Duration = kotlinStdLib.time.Duration } namespace kotlin.collections { - type Collection = kotlinStdLib.kotlin.collections.Collection - type List = kotlinStdLib.kotlin.collections.List - type Set = kotlinStdLib.kotlin.collections.Set - type Map = kotlinStdLib.kotlin.collections.Map + type Collection = kotlinStdLib.collections.Collection + type List = kotlinStdLib.collections.List + type Set = kotlinStdLib.collections.Set + type Map = kotlinStdLib.collections.Map } namespace kotlinx.datetime { - type Instant = kotlinDateTime.kotlinx.datetime.Instant + type Instant = kotlinDateTime.datetime.Instant } namespace kotlinx.serialization.json { - type Json = kotlinSerialization.kotlinx.serialization.json.Json + type Json = kotlinSerialization.serialization.json.Json } } @@ -46,5 +46,5 @@ extend.dk.cachet.carp.common = carpCommon.dk.cachet.carp.common as any; extend.dk.cachet.carp.deployments = carpDeployments.dk.cachet.carp.deployments as any; -// Export facade. -export * from "@cachet/carp-studies-core-generated" +// Re-export augmented types. +export { default } from "@cachet/carp-studies-core-generated" diff --git a/typescript-declarations/carp-studies-core/package.json b/typescript-declarations/carp-studies-core/package.json index ab9026b8d..c3bc8863a 100644 --- a/typescript-declarations/carp-studies-core/package.json +++ b/typescript-declarations/carp-studies-core/package.json @@ -1,4 +1,6 @@ { "name": "@cachet/carp-studies-core", + "type": "module", + "main": "index.js", "version": "1.1.2" } diff --git a/typescript-declarations/package.json b/typescript-declarations/package.json index a0d359897..6344f873f 100644 --- a/typescript-declarations/package.json +++ b/typescript-declarations/package.json @@ -1,4 +1,5 @@ { + "type": "module", "scripts": { "tsc": "tsc" }, diff --git a/typescript-declarations/tests/carp-common-test.ts b/typescript-declarations/tests/carp-common-test.ts index 881f6441b..116c0900f 100644 --- a/typescript-declarations/tests/carp-common-test.ts +++ b/typescript-declarations/tests/carp-common-test.ts @@ -1,13 +1,14 @@ import { expect } from 'chai' -import { kotlin } from '@cachet/carp-kotlin' +import kotlin from '@cachet/carp-kotlin' import setOf = kotlin.collections.setOf import Duration = kotlin.time.Duration -import { kotlinx } from '@cachet/carp-kotlinx-serialization' +import kotlinx from '@cachet/carp-kotlinx-serialization' import getSerializer = kotlinx.serialization.getSerializer -import { dk } from '@cachet/carp-common' +import carp from '@cachet/carp-common' +import dk = carp.dk import Trilean = dk.cachet.carp.common.application.Trilean import toTrilean = dk.cachet.carp.common.application.toTrilean import EmailAddress = dk.cachet.carp.common.application.EmailAddress diff --git a/typescript-declarations/tests/carp-deployments-test.ts b/typescript-declarations/tests/carp-deployments-test.ts index 6dce216a7..aec27e9d5 100644 --- a/typescript-declarations/tests/carp-deployments-test.ts +++ b/typescript-declarations/tests/carp-deployments-test.ts @@ -1,18 +1,19 @@ import { expect } from 'chai' -import { kotlin } from '@cachet/carp-kotlin' +import kotlin from '@cachet/carp-kotlin' import Nullable = kotlin.Nullable import mapOf = kotlin.collections.mapOf import Map = kotlin.collections.Map import Pair = kotlin.Pair -import { dk } from '@cachet/carp-deployments-core' +import carp from '@cachet/carp-deployments-core' +import dk = carp.dk import common = dk.cachet.carp.common -import NamespacedId = dk.cachet.carp.common.application.NamespacedId -import Data = dk.cachet.carp.common.application.data.Data -import CarpInputDataTypes = dk.cachet.carp.common.application.data.input.CarpInputDataTypes -import Sex = dk.cachet.carp.common.application.data.input.Sex +import NamespacedId = common.application.NamespacedId +import Data = common.application.data.Data +import CarpInputDataTypes = common.application.data.input.CarpInputDataTypes +import Sex = common.application.data.input.Sex import UUID = common.application.UUID import deployments = dk.cachet.carp.deployments diff --git a/typescript-declarations/tests/carp-kotlin-test.ts b/typescript-declarations/tests/carp-kotlin-test.ts index bec617b46..4033251d0 100644 --- a/typescript-declarations/tests/carp-kotlin-test.ts +++ b/typescript-declarations/tests/carp-kotlin-test.ts @@ -1,7 +1,7 @@ -import VerifyModule from './VerifyModule' +import VerifyModule from './VerifyModule.js' import { expect } from 'chai' -import { kotlin } from '@cachet/carp-kotlin' +import kotlin from '@cachet/carp-kotlin' import toLong = kotlin.toLong import Pair = kotlin.Pair import Duration = kotlin.time.Duration diff --git a/typescript-declarations/tests/carp-kotlinx-datetime-test.ts b/typescript-declarations/tests/carp-kotlinx-datetime-test.ts index a33d805ef..b22769de3 100644 --- a/typescript-declarations/tests/carp-kotlinx-datetime-test.ts +++ b/typescript-declarations/tests/carp-kotlinx-datetime-test.ts @@ -1,7 +1,7 @@ -import VerifyModule from './VerifyModule' +import VerifyModule from './VerifyModule.js' import { expect } from 'chai' -import { kotlinx } from '@cachet/carp-kotlinx-datetime' +import kotlinx from '@cachet/carp-kotlinx-datetime' import Clock = kotlinx.datetime.Clock @@ -34,4 +34,4 @@ describe( "kotlinx-datetime", () => { expect( now.toEpochMilliseconds() ).not.undefined } ) } ) -} ) \ No newline at end of file +} ) diff --git a/typescript-declarations/tests/carp-kotlinx-serialization-test.ts b/typescript-declarations/tests/carp-kotlinx-serialization-test.ts index 41835732d..66888e705 100644 --- a/typescript-declarations/tests/carp-kotlinx-serialization-test.ts +++ b/typescript-declarations/tests/carp-kotlinx-serialization-test.ts @@ -1,7 +1,7 @@ -import VerifyModule from './VerifyModule' +import VerifyModule from './VerifyModule.js' import { expect } from 'chai' -import { kotlinx } from '@cachet/carp-kotlinx-serialization' +import kotlinx from '@cachet/carp-kotlinx-serialization' import Json = kotlinx.serialization.json.Json diff --git a/typescript-declarations/tests/carp-protocols-test.ts b/typescript-declarations/tests/carp-protocols-test.ts index ae237c388..faacf92ea 100644 --- a/typescript-declarations/tests/carp-protocols-test.ts +++ b/typescript-declarations/tests/carp-protocols-test.ts @@ -1,18 +1,21 @@ import { expect } from 'chai' -import { dk as cdk } from '@cachet/carp-common' -import JSON = cdk.cachet.carp.common.infrastructure.serialization.JSON -import UUID = cdk.cachet.carp.common.application.UUID +import kxs from '@cachet/carp-kotlinx-serialization' +import getSerializer = kxs.serialization.getSerializer -import { kotlinx } from '@cachet/carp-kotlinx-serialization' -import getSerializer = kotlinx.serialization.getSerializer +import kxdt from '@cachet/carp-kotlinx-datetime' +import Clock = kxdt.datetime.Clock -import { kotlinx as datetime } from '@cachet/carp-kotlinx-datetime' -import Clock = datetime.datetime.Clock +import carp from '@cachet/carp-protocols-core' +import dk = carp.dk -import { dk } from '@cachet/carp-protocols-core' -import StudyProtocolSnapshot = dk.cachet.carp.protocols.application.StudyProtocolSnapshot -import ProtocolServiceRequest = dk.cachet.carp.protocols.infrastructure.ProtocolServiceRequest +import common = dk.cachet.carp.common +import JSON = common.infrastructure.serialization.JSON +import UUID = common.application.UUID + +import protocols = dk.cachet.carp.protocols +import StudyProtocolSnapshot = protocols.application.StudyProtocolSnapshot +import ProtocolServiceRequest = protocols.infrastructure.ProtocolServiceRequest const serializedSnapshot = `{"id":"ad4ca03a-6f69-4a95-8701-488dc511925b","createdOn":"2023-01-30T21:02:56.068710100Z","version":0,"ownerId":"27879e75-ccc1-4866-9ab3-4ece1b735052","name":"Test protocol","description":"Test description","primaryDevices":[{"__type":"dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration","isPrimaryDevice":true,"roleName":"Stub primary device"}],"connectedDevices":[{"__type":"dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration","roleName":"Stub device"},{"__type":"dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration","isPrimaryDevice":true,"roleName":"Chained primary"},{"__type":"dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration","roleName":"Chained connected"}],"connections":[{"roleName":"Stub device","connectedToRoleName":"Stub primary device"},{"roleName":"Chained primary","connectedToRoleName":"Stub primary device"},{"roleName":"Chained connected","connectedToRoleName":"Chained primary"}],"tasks":[{"__type":"dk.cachet.carp.common.infrastructure.test.StubTaskConfiguration","name":"Task","measures":[{"__type":"dk.cachet.carp.common.application.tasks.Measure.DataStream","type":"dk.cachet.carp.stubpoint"}]}],"triggers":{"0":{"__type":"dk.cachet.carp.common.infrastructure.test.StubTriggerConfiguration","sourceDeviceRoleName":"Stub device"}},"taskControls":[{"triggerId":0,"taskName":"Task","destinationDeviceRoleName":"Stub primary device","control":"Start"}],"participantRoles":[{"role":"Role","isOptional":false},{"role":"Optional role","isOptional":true}],"assignedDevices":{"Stub primary device":["Role"]},"expectedParticipantData":[{"attribute":{"__type":"dk.cachet.carp.common.application.users.ParticipantAttribute.DefaultParticipantAttribute","inputDataType":"some.type"}},{"attribute":{"__type":"dk.cachet.carp.common.application.users.ParticipantAttribute.DefaultParticipantAttribute","inputDataType":"dk.cachet.carp.input.sex"},"assignedTo":{"__type":"dk.cachet.carp.common.application.users.AssignedTo.Roles","roleNames":["Role"]}}]}` diff --git a/typescript-declarations/tests/carp-studies-test.ts b/typescript-declarations/tests/carp-studies-test.ts index 844fcd42b..0dd53b773 100644 --- a/typescript-declarations/tests/carp-studies-test.ts +++ b/typescript-declarations/tests/carp-studies-test.ts @@ -1,17 +1,18 @@ import { expect } from 'chai' -import { kotlin } from '@cachet/carp-kotlin' +import kotlin from '@cachet/carp-kotlin' import setOf = kotlin.collections.setOf import listOf = kotlin.collections.listOf -import { kotlinx as kxd } from '@cachet/carp-kotlinx-datetime' +import kxd from '@cachet/carp-kotlinx-datetime' import Clock = kxd.datetime.Clock -import { kotlinx as kxs } from '@cachet/carp-kotlinx-serialization' +import kxs from '@cachet/carp-kotlinx-serialization' import getSerializer = kxs.serialization.getSerializer import ListSerializer = kxs.serialization.builtins.ListSerializer -import { dk } from '@cachet/carp-studies-core' +import carp from '@cachet/carp-studies-core' +import dk = carp.dk import common = dk.cachet.carp.common import UUID = common.application.UUID From fe1ab05bc97031542dc03f8bd5a1ad57b8309a29 Mon Sep 17 00:00:00 2001 From: Whathecode Date: Thu, 22 Feb 2024 23:13:11 +0100 Subject: [PATCH 5/5] Explicit references to ambient module declaration files Without these, projects using the output modules did not automatically pick up the typescript declarations. --- typescript-declarations/carp-kotlin/index.ts | 1 + typescript-declarations/carp-kotlinx-datetime/index.ts | 1 + typescript-declarations/carp-kotlinx-serialization/index.ts | 2 ++ 3 files changed, 4 insertions(+) diff --git a/typescript-declarations/carp-kotlin/index.ts b/typescript-declarations/carp-kotlin/index.ts index b7a61db40..69fd05ace 100644 --- a/typescript-declarations/carp-kotlin/index.ts +++ b/typescript-declarations/carp-kotlin/index.ts @@ -1,3 +1,4 @@ +/// import extend from "@cachet/kotlin-kotlin-stdlib" diff --git a/typescript-declarations/carp-kotlinx-datetime/index.ts b/typescript-declarations/carp-kotlinx-datetime/index.ts index cfc51a4fa..fa0dc10e9 100644 --- a/typescript-declarations/carp-kotlinx-datetime/index.ts +++ b/typescript-declarations/carp-kotlinx-datetime/index.ts @@ -1,3 +1,4 @@ +/// import extend from "@cachet/Kotlin-DateTime-library-kotlinx-datetime-js-ir" diff --git a/typescript-declarations/carp-kotlinx-serialization/index.ts b/typescript-declarations/carp-kotlinx-serialization/index.ts index d585a171d..57959dcad 100644 --- a/typescript-declarations/carp-kotlinx-serialization/index.ts +++ b/typescript-declarations/carp-kotlinx-serialization/index.ts @@ -1,3 +1,5 @@ +/// +/// import extendCore from "@cachet/kotlinx-serialization-kotlinx-serialization-core" import extendJson from "@cachet/kotlinx-serialization-kotlinx-serialization-json"