From d15ffa959f99e8082b5c2898fcc1af4b7e3f55a7 Mon Sep 17 00:00:00 2001 From: Arjun Attam Date: Mon, 8 Apr 2024 13:06:41 +0530 Subject: [PATCH 1/4] [wip] generate schema programmatically --- development/schema/script.js | 19 +++++ package.json | 3 + packages/cli/src/types/index.ts | 1 + pnpm-lock.yaml | 141 +++++++++++++++++++++++--------- 4 files changed, 126 insertions(+), 38 deletions(-) create mode 100644 development/schema/script.js diff --git a/development/schema/script.js b/development/schema/script.js new file mode 100644 index 00000000..24782fb2 --- /dev/null +++ b/development/schema/script.js @@ -0,0 +1,19 @@ +const tsj = require("ts-json-schema-generator"); +const fs = require("fs"); + +/** @type {import('ts-json-schema-generator/dist/src/Config').Config} */ +const config = { + path: "./packages/cli/src/types/index.ts", + tsconfig: "./packages/cli/tsconfig.json", + type: "RunsConfig", // Or if you want to generate schema for that one type only +}; + +// const output_path = "path/to/output/file"; + +const schema = tsj.createGenerator(config).createSchema(config.type); +const schemaString = JSON.stringify(schema, null, 2); +console.log(schemaString); + +// fs.writeFile(output_path, schemaString, (err) => { +// if (err) throw err; +// }); diff --git a/package.json b/package.json index b05a962c..0c436dae 100644 --- a/package.json +++ b/package.json @@ -27,5 +27,8 @@ "packageManager": "pnpm@8.5.0", "engines": { "node": ">=20" + }, + "dependencies": { + "ts-json-schema-generator": "^1.5.0" } } diff --git a/packages/cli/src/types/index.ts b/packages/cli/src/types/index.ts index 2fa3f87b..bd84e0f2 100644 --- a/packages/cli/src/types/index.ts +++ b/packages/cli/src/types/index.ts @@ -3,4 +3,5 @@ import { RunConfig, DatasetConfig } from "@empiricalrun/types"; export type RunsConfig = { runs: RunConfig[]; dataset: DatasetConfig; + $schema?: string; }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e0c60d80..fd9d931d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,8 +1,16 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + importers: .: + dependencies: + ts-json-schema-generator: + specifier: ^1.5.0 + version: 1.5.0 devDependencies: '@changesets/cli': specifier: ^2.27.1 @@ -24,7 +32,7 @@ importers: version: 3.4.1 turbo: specifier: latest - version: 1.13.0 + version: 1.13.2 turbowatch: specifier: ^2.29.4 version: 2.29.4 @@ -2068,7 +2076,6 @@ packages: /@types/json-schema@7.0.12: resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} - dev: true /@types/json5@0.0.29: resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} @@ -2544,7 +2551,7 @@ packages: eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.29.0) eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.17.0)(eslint-plugin-import@2.29.0)(eslint@8.57.0) eslint-plugin-eslint-comments: 3.2.0(eslint@8.57.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.1.0)(eslint@8.57.0) eslint-plugin-jest: 27.6.0(@typescript-eslint/eslint-plugin@6.17.0)(eslint@8.57.0)(typescript@5.3.3) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-playwright: 0.16.0(eslint-plugin-jest@27.6.0)(eslint@8.57.0) @@ -3197,6 +3204,11 @@ packages: delayed-stream: 1.0.0 dev: false + /commander@11.1.0: + resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} + engines: {node: '>=16'} + dev: false + /commander@12.0.0: resolution: {integrity: sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==} engines: {node: '>=18'} @@ -3718,7 +3730,7 @@ packages: peerDependencies: eslint-plugin-import: '>=1.4.0' dependencies: - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.1.0)(eslint@8.57.0) dev: true /eslint-import-resolver-node@0.3.9: @@ -3741,8 +3753,8 @@ packages: debug: 4.3.4 enhanced-resolve: 5.15.0 eslint: 8.57.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.1.0)(eslint@8.57.0) fast-glob: 3.3.1 get-tsconfig: 4.7.2 is-core-module: 2.13.1 @@ -3754,7 +3766,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -3778,12 +3790,40 @@ packages: '@typescript-eslint/parser': 6.17.0(eslint@8.57.0)(typescript@5.3.3) debug: 3.2.7 eslint: 8.57.0 - eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.17.0)(eslint-plugin-import@2.29.0)(eslint@8.57.0) transitivePeerDependencies: - supports-color dev: true + /eslint-module-utils@2.8.0(@typescript-eslint/parser@7.1.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + '@typescript-eslint/parser': 7.1.0(eslint@8.57.0)(typescript@5.3.3) + debug: 3.2.7 + eslint: 8.57.0 + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + dev: true + /eslint-plugin-eslint-comments@3.2.0(eslint@8.57.0): resolution: {integrity: sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ==} engines: {node: '>=6.5.0'} @@ -3795,7 +3835,7 @@ packages: ignore: 5.3.1 dev: true - /eslint-plugin-import@2.29.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + /eslint-plugin-import@2.29.0(@typescript-eslint/parser@7.1.0)(eslint@8.57.0): resolution: {integrity: sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==} engines: {node: '>=4'} peerDependencies: @@ -3805,7 +3845,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.17.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/parser': 7.1.0(eslint@8.57.0)(typescript@5.3.3) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -3814,7 +3854,7 @@ packages: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.1.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -4474,7 +4514,6 @@ packages: /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - dev: true /fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} @@ -4598,6 +4637,17 @@ packages: path-is-absolute: 1.0.1 dev: true + /glob@8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.6 + once: 1.4.0 + dev: false + /glob@9.3.5: resolution: {integrity: sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==} engines: {node: '>=16 || 14 >=14.17'} @@ -4785,7 +4835,6 @@ packages: dependencies: once: 1.4.0 wrappy: 1.0.2 - dev: true /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -5134,7 +5183,6 @@ packages: /json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} - dev: true /jsonc-parser@3.2.1: resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} @@ -5401,6 +5449,13 @@ packages: brace-expansion: 1.1.11 dev: true + /minimatch@5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: false + /minimatch@8.0.4: resolution: {integrity: sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==} engines: {node: '>=16 || 14 >=14.17'} @@ -5692,7 +5747,6 @@ packages: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: wrappy: 1.0.2 - dev: true /onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} @@ -6465,7 +6519,6 @@ packages: /safe-stable-stringify@2.4.3: resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==} engines: {node: '>=10'} - dev: true /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -7052,6 +7105,20 @@ packages: /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + /ts-json-schema-generator@1.5.0: + resolution: {integrity: sha512-RkiaJ6YxGc5EWVPfyHxszTmpGxX8HC2XBvcFlAl1zcvpOG4tjjh+eXioStXJQYTvr9MoK8zCOWzAUlko3K0DiA==} + engines: {node: '>=10.0.0'} + hasBin: true + dependencies: + '@types/json-schema': 7.0.12 + commander: 11.1.0 + glob: 8.1.0 + json5: 2.2.3 + normalize-path: 3.0.0 + safe-stable-stringify: 2.4.3 + typescript: 5.3.3 + dev: false + /tsconfig-paths@3.14.2: resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==} dependencies: @@ -7092,64 +7159,64 @@ packages: yargs: 17.7.2 dev: true - /turbo-darwin-64@1.13.0: - resolution: {integrity: sha512-ctHeJXtQgBcgxnCXwrJTGiq57HtwF7zWz5NTuSv//5yeU01BtQIt62ArKfjudOhRefWJbX3Z5srn88XTb9hfww==} + /turbo-darwin-64@1.13.2: + resolution: {integrity: sha512-CCSuD8CfmtncpohCuIgq7eAzUas0IwSbHfI8/Q3vKObTdXyN8vAo01gwqXjDGpzG9bTEVedD0GmLbD23dR0MLA==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-darwin-arm64@1.13.0: - resolution: {integrity: sha512-/Q9/pNFkF9w83tNxwMpgapwLYdQ12p8mpty2YQRoUiS9ClWkcqe136jR0mtuMqzlNlpREOFZaoyIthjt6Sdo0g==} + /turbo-darwin-arm64@1.13.2: + resolution: {integrity: sha512-0HySm06/D2N91rJJ89FbiI/AodmY8B3WDSFTVEpu2+8spUw7hOJ8okWOT0e5iGlyayUP9gr31eOeL3VFZkpfCw==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-linux-64@1.13.0: - resolution: {integrity: sha512-hgbT7o020BGV4L7Sd8hhFTd5zVKPKxbsr0dPfel/9NkdTmptz2aGZ0Vb2MAa18SY3XaCQpDxmdYuOzvvRpo5ZA==} + /turbo-linux-64@1.13.2: + resolution: {integrity: sha512-7HnibgbqZrjn4lcfIouzlPu8ZHSBtURG4c7Bedu7WJUDeZo+RE1crlrQm8wuwO54S0siYqUqo7GNHxu4IXbioQ==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm64@1.13.0: - resolution: {integrity: sha512-WK01i2wDZARrV+HEs495A3hNeGMwQR5suYk7G+ceqqW7b+dOTlQdvUjnI3sg7wAnZPgjafFs/hoBaZdJjVa/nw==} + /turbo-linux-arm64@1.13.2: + resolution: {integrity: sha512-sUq4dbpk6SNKg/Hkwn256Vj2AEYSQdG96repio894h5/LEfauIK2QYiC/xxAeW3WBMc6BngmvNyURIg7ltrePg==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-windows-64@1.13.0: - resolution: {integrity: sha512-hJgSZJZwlWHNwLEthaqJqJWGm4NqF5X/I7vE0sPE4i/jeDl8f0n1hcOkgJkJiNXVxhj+qy/9+4dzbPLKT9imaQ==} + /turbo-windows-64@1.13.2: + resolution: {integrity: sha512-DqzhcrciWq3dpzllJR2VVIyOhSlXYCo4mNEWl98DJ3FZ08PEzcI3ceudlH6F0t/nIcfSItK1bDP39cs7YoZHEA==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-arm64@1.13.0: - resolution: {integrity: sha512-L/ErxYoXeq8tmjU/AIGicC9VyBN1zdYw8JlM4yPmMI0pJdY8E4GaYK1IiIazqq7M72lmQhU/WW7fV9FqEktwrw==} + /turbo-windows-arm64@1.13.2: + resolution: {integrity: sha512-WnPMrwfCXxK69CdDfS1/j2DlzcKxSmycgDAqV0XCYpK/812KB0KlvsVAt5PjEbZGXkY88pCJ1BLZHAjF5FcbqA==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /turbo@1.13.0: - resolution: {integrity: sha512-r02GtNmkOPcQvUzVE6lg474QVLyU02r3yh3lUGqrFHf5h5ZEjgDGWILsAUqplVqjri1Y/oOkTssks4CObTAaiw==} + /turbo@1.13.2: + resolution: {integrity: sha512-rX/d9f4MgRT3yK6cERPAkfavIxbpBZowDQpgvkYwGMGDQ0Nvw1nc0NVjruE76GrzXQqoxR1UpnmEP54vBARFHQ==} hasBin: true optionalDependencies: - turbo-darwin-64: 1.13.0 - turbo-darwin-arm64: 1.13.0 - turbo-linux-64: 1.13.0 - turbo-linux-arm64: 1.13.0 - turbo-windows-64: 1.13.0 - turbo-windows-arm64: 1.13.0 + turbo-darwin-64: 1.13.2 + turbo-darwin-arm64: 1.13.2 + turbo-linux-64: 1.13.2 + turbo-linux-arm64: 1.13.2 + turbo-windows-64: 1.13.2 + turbo-windows-arm64: 1.13.2 dev: true /turbowatch@2.29.4: @@ -7262,7 +7329,6 @@ packages: /typescript@5.3.3: resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} engines: {node: '>=14.17'} - dev: true /ufo@1.4.0: resolution: {integrity: sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==} @@ -7645,7 +7711,6 @@ packages: /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - dev: true /y18n@4.0.3: resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} From 38544be35c9864b5c2417cdf39240cb253cfa879 Mon Sep 17 00:00:00 2001 From: Saikat Mitra Date: Tue, 9 Apr 2024 01:17:29 +0530 Subject: [PATCH 2/4] chore: add json schema generator --- .github/workflows/json-schema-upload.yml | 42 +++ development/README.md | 17 +- development/schema/README.md | 15 - development/schema/schema.json | 320 ------------------ development/schema/script.js | 19 -- package.json | 3 +- packages/ai/package.json | 2 +- packages/cli/package.json | 2 +- packages/core/package.json | 2 +- packages/json-schema/.eslintrc.js | 11 + packages/json-schema/.npmignore | 5 + packages/json-schema/README.md | 4 + packages/json-schema/package.json | 21 ++ packages/json-schema/src/index.ts | 21 ++ packages/json-schema/tsconfig.json | 9 + packages/json-schema/tsconfig.lint.json | 8 + packages/scorer/package.json | 2 +- packages/types/package.json | 2 +- pnpm-lock.yaml | 196 +++++++---- .../package/library/package.json.hbs | 2 +- 20 files changed, 279 insertions(+), 424 deletions(-) create mode 100644 .github/workflows/json-schema-upload.yml delete mode 100644 development/schema/README.md delete mode 100644 development/schema/schema.json delete mode 100644 development/schema/script.js create mode 100644 packages/json-schema/.eslintrc.js create mode 100644 packages/json-schema/.npmignore create mode 100644 packages/json-schema/README.md create mode 100644 packages/json-schema/package.json create mode 100644 packages/json-schema/src/index.ts create mode 100644 packages/json-schema/tsconfig.json create mode 100644 packages/json-schema/tsconfig.lint.json diff --git a/.github/workflows/json-schema-upload.yml b/.github/workflows/json-schema-upload.yml new file mode 100644 index 00000000..676bffa3 --- /dev/null +++ b/.github/workflows/json-schema-upload.yml @@ -0,0 +1,42 @@ +name: Upload JSON Schema + +on: workflow_dispatch + +jobs: + upload: + name: Publish packages + timeout-minutes: 8 + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - uses: pnpm/action-setup@v3 + with: + version: 8.5 + + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Lint + run: pnpm lint + + - name: Build + run: pnpm build + + - uses: ryand56/r2-upload-action@latest + with: + r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} + r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} + r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} + r2-bucket: ${{ secrets.R2_BUCKET }} + source-dir: ./packages/json-schema/dist/ + destination-dir: ./config/schema/ diff --git a/development/README.md b/development/README.md index 568ff12e..e609b59d 100644 --- a/development/README.md +++ b/development/README.md @@ -42,6 +42,20 @@ Follow these concise steps to set up and contribute to this monorepo: pnpm run gen:workspace ``` +### JSON Schema + +Enables auto-completion and linting inside VS Code. + +## Development + +1. Test the changes locally by changing the schema file in one of the examples to + ```json + "$schema": "../../packages/json-schema/dist/latest.json", + ``` +2. Upload the new version to Cloudflare using github action CI pipeline +3. Update the schema reference for the examples to the new version +4. Commit the updated schema file + ### Testing - **Run Tests**: @@ -71,4 +85,5 @@ Before creating a pull request (PR), follow these steps: Follow the prompts presented by the changeset CLI to add the changeset to your PR. - > Note: If the changes do not require a version upgrade for the packages, you may skip adding a changeset. \ No newline at end of file + > Note: If the changes do not require a version upgrade for the packages, you may skip adding a changeset. + diff --git a/development/schema/README.md b/development/schema/README.md deleted file mode 100644 index c496a35a..00000000 --- a/development/schema/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# JSON Schema - -Enables auto-completion and linting inside VS Code. - -## Development - -1. Edit the the schema file if the config file has changed -2. Test the changes locally by changing the schema file in one of the examples - ```json - "$schema": "../../development/schema/schema.json", - ``` - -3. Upload the new version to Cloudflare (after renaming the file to the next version): [location](https://dash.cloudflare.com/6f3f2ef0dbeefd01119c8818ed8e3dfe/r2/default/buckets/empirical-assets-production) -4. Update the schema reference for the examples to the new version -5. Commit the updated schema file diff --git a/development/schema/schema.json b/development/schema/schema.json deleted file mode 100644 index eeba3912..00000000 --- a/development/schema/schema.json +++ /dev/null @@ -1,320 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "runs": { - "type": "array", - "minItems": 1, - "items": { - "anyOf": [ - { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string", - "const": "model" - }, - "provider": { - "type": "string", - "enum": [ - "openai", - "google", - "mistral", - "anthropic", - "fireworks" - ] - }, - "model": { - "type": "string" - }, - "prompt": { - "type": "string" - }, - "parameters": { - "type": "object", - "properties": { - "temperature": { - "type": "number" - }, - "max_tokens": { - "type": "number" - }, - "top_p": { - "type": "number" - }, - "frequency_penalty": { - "type": "number" - }, - "logprobs": { - "type": "boolean" - }, - "n": { - "type": "number" - }, - "presence_penalty": { - "type": "number" - }, - "response_format": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["json_object", "text"] - } - } - }, - "seed": { - "type": "number" - }, - "stop": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "top_logprobs": { - "type": "number" - } - }, - "additionalProperties": true - }, - "scorers": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "is-json", - "sql-syntax", - "sql-semantic" - ] - }, - "threshold": { - "type": "number" - } - }, - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "llm-criteria" - ] - }, - "threshold": { - "type": "number" - }, - "name": { - "type": "string" - }, - "criteria": { - "type": "string" - } - }, - "required": [ - "type", - "criteria" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "py-script" - ] - }, - "threshold": { - "type": "number" - }, - "name": { - "type": "string" - }, - "path": { - "type": "string" - } - }, - "required": [ - "type", - "path" - ] - } - ] - } - } - }, - "required": [ - "type", - "provider", - "model" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "py-script", - "js-script" - ] - }, - "path": { - "type": "string" - }, - "parameters": { - "type": "object" - }, - "scorers": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "is-json", - "sql-syntax", - "sql-semantic" - ] - }, - "threshold": { - "type": "number" - } - }, - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "llm-criteria" - ] - }, - "threshold": { - "type": "number" - }, - "name": { - "type": "string" - }, - "criteria": { - "type": "string" - } - }, - "required": [ - "type", - "criteria" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "py-script" - ] - }, - "threshold": { - "type": "number" - }, - "name": { - "type": "string" - }, - "path": { - "type": "string" - } - }, - "required": [ - "type", - "path" - ] - } - ] - } - } - }, - "required": [ - "type", - "path" - ], - "additionalProperties": false - } - ] - } - }, - "dataset": { - "type": "object", - "properties": { - "samples": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "inputs": { - "type": "object", - "items": { - "type": "object", - "patternProperties": { - "^.*$": { - "type": "string" - } - }, - "additionalProperties": false - } - } - }, - "required": [ - "inputs" - ] - } - }, - "path": { - "type": "string" - } - }, - "additionalProperties": false - }, - "$schema": { - "type": "string" - } - }, - "required": [ - "runs", - "dataset" - ], - "additionalProperties": false -} \ No newline at end of file diff --git a/development/schema/script.js b/development/schema/script.js deleted file mode 100644 index 24782fb2..00000000 --- a/development/schema/script.js +++ /dev/null @@ -1,19 +0,0 @@ -const tsj = require("ts-json-schema-generator"); -const fs = require("fs"); - -/** @type {import('ts-json-schema-generator/dist/src/Config').Config} */ -const config = { - path: "./packages/cli/src/types/index.ts", - tsconfig: "./packages/cli/tsconfig.json", - type: "RunsConfig", // Or if you want to generate schema for that one type only -}; - -// const output_path = "path/to/output/file"; - -const schema = tsj.createGenerator(config).createSchema(config.type); -const schemaString = JSON.stringify(schema, null, 2); -console.log(schemaString); - -// fs.writeFile(output_path, schemaString, (err) => { -// if (err) throw err; -// }); diff --git a/package.json b/package.json index 0c436dae..410dccf3 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "test": "turbo test", "test:watch": "turbo run test:watch", "publish-packages": "changeset publish", - "changeset": "changeset" + "changeset": "changeset", + "generate:schema": "turbo schema" }, "devDependencies": { "@changesets/cli": "^2.27.1", diff --git a/packages/ai/package.json b/packages/ai/package.json index dc211a9c..ed41aca4 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -6,7 +6,7 @@ "access": "public" }, "main": "dist/index.js", - "author": "Empirical.run Team ", + "author": "Empirical Team ", "license": "MIT", "repository": { "type": "git", diff --git a/packages/cli/package.json b/packages/cli/package.json index 486ab9c3..1ca5f662 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -9,7 +9,7 @@ "bin": { "@empiricalrun/cli": "./dist/bin/index.js" }, - "author": "Empirical.run Team ", + "author": "Empirical Team ", "license": "MIT", "repository": { "type": "git", diff --git a/packages/core/package.json b/packages/core/package.json index 551c3dfa..0266d71c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -6,7 +6,7 @@ "access": "public" }, "main": "dist/index.js", - "author": "Empirical.run Team ", + "author": "Empirical Team ", "license": "MIT", "repository": { "type": "git", diff --git a/packages/json-schema/.eslintrc.js b/packages/json-schema/.eslintrc.js new file mode 100644 index 00000000..053927f1 --- /dev/null +++ b/packages/json-schema/.eslintrc.js @@ -0,0 +1,11 @@ +// This configuration only applies to the package manager root. +/** @type {import("eslint").Linter.Config} */ +module.exports = { + root: true, + extends: ["@empiricalrun/eslint-config/library.js"], + parser: "@typescript-eslint/parser", + parserOptions: { + project: "./tsconfig.lint.json", + tsconfigRootDir: __dirname, + }, +}; diff --git a/packages/json-schema/.npmignore b/packages/json-schema/.npmignore new file mode 100644 index 00000000..6e1f9f00 --- /dev/null +++ b/packages/json-schema/.npmignore @@ -0,0 +1,5 @@ +.turbo +src +node_modules +tsconfig*.json +.eslintrc.js \ No newline at end of file diff --git a/packages/json-schema/README.md b/packages/json-schema/README.md new file mode 100644 index 00000000..0f55844d --- /dev/null +++ b/packages/json-schema/README.md @@ -0,0 +1,4 @@ +# json-schema + +maintains schema store format json for `.empiricalrc.json`. visit https://www.schemastore.org/json/ to understand more on schema store format. + diff --git a/packages/json-schema/package.json b/packages/json-schema/package.json new file mode 100644 index 00000000..d7a6b162 --- /dev/null +++ b/packages/json-schema/package.json @@ -0,0 +1,21 @@ +{ + "name": "@empiricalrun/json-schema", + "version": "0.0.0", + "private": true, + "repository": { + "type": "git", + "url": "https://github.com/empirical-run/empirical.git" + }, + "author": "Empirical Team ", + "scripts": { + "build": "ts-node src/index.ts", + "lint": "eslint ." + }, + "dependencies": { + "ts-json-schema-generator": "^1.5.0" + }, + "devDependencies": { + "ts-node": "^10.9.2", + "@types/node": "^20.11.24" + } +} \ No newline at end of file diff --git a/packages/json-schema/src/index.ts b/packages/json-schema/src/index.ts new file mode 100644 index 00000000..c80790e3 --- /dev/null +++ b/packages/json-schema/src/index.ts @@ -0,0 +1,21 @@ +import { createGenerator, Config } from "ts-json-schema-generator"; +import path from "path"; +import fs from "fs"; +import packageJson from "./../../cli/package.json"; + +const tsconfigPath = path.join(__dirname, "./../../cli/tsconfig.json"); +const typesPath = path.join(__dirname, "./../../cli/src/types/index.ts"); + +const config: Config = { + path: typesPath, + tsconfig: tsconfigPath, + type: "RunsConfig", +}; +const schema = createGenerator(config).createSchema(config.type); +const schemaString = JSON.stringify(schema, null, 2); +const outputPath = path.join(__dirname, "./../dist"); +fs.mkdirSync(path.join(__dirname, "./../dist"), { recursive: true }); +// create a version file +fs.writeFileSync(`${outputPath}/v${packageJson.version}.json`, schemaString); +// create latest version file +fs.writeFileSync(`${outputPath}/latest.json`, schemaString); diff --git a/packages/json-schema/tsconfig.json b/packages/json-schema/tsconfig.json new file mode 100644 index 00000000..2c9d4c85 --- /dev/null +++ b/packages/json-schema/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@empiricalrun/typescript-config/base.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "src/**/*.test.ts"] +} diff --git a/packages/json-schema/tsconfig.lint.json b/packages/json-schema/tsconfig.lint.json new file mode 100644 index 00000000..398a613b --- /dev/null +++ b/packages/json-schema/tsconfig.lint.json @@ -0,0 +1,8 @@ +{ + "extends": "@empiricalrun/typescript-config/base.json", + "compilerOptions": { + "outDir": "dist" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/scorer/package.json b/packages/scorer/package.json index 6f926784..e98f2ff4 100644 --- a/packages/scorer/package.json +++ b/packages/scorer/package.json @@ -7,7 +7,7 @@ }, "main": "dist/index.js", "types": "dist/index.d.ts", - "author": "Empirical.run Team ", + "author": "Empirical Team ", "license": "MIT", "repository": { "type": "git", diff --git a/packages/types/package.json b/packages/types/package.json index 84cf71aa..5dff6afe 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -7,7 +7,7 @@ }, "main": "dist/index.js", "types": "dist/index.d.ts", - "author": "Empirical.run Team ", + "author": "Empirical Team ", "license": "MIT", "repository": { "type": "git", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fd9d931d..61047085 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,9 +1,5 @@ lockfileVersion: '6.0' -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - importers: .: @@ -32,7 +28,7 @@ importers: version: 3.4.1 turbo: specifier: latest - version: 1.13.2 + version: 1.13.0 turbowatch: specifier: ^2.29.4 version: 2.29.4 @@ -272,6 +268,19 @@ importers: specifier: ^5.3.3 version: 5.3.3 + packages/json-schema: + dependencies: + '@types/node': + specifier: ^20.11.24 + version: 20.11.24 + ts-json-schema-generator: + specifier: ^1.5.0 + version: 1.5.0 + devDependencies: + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@types/node@20.11.24)(typescript@5.3.3) + packages/scorer: dependencies: '@empiricalrun/ai': @@ -741,6 +750,13 @@ packages: prettier: 2.8.8 dev: true + /@cspotcode/source-map-support@0.8.1: + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + dev: true + /@esbuild/aix-ppc64@0.20.2: resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==} engines: {node: '>=12'} @@ -1081,6 +1097,13 @@ packages: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 + /@jridgewell/trace-mapping@0.3.9: + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + dependencies: + '@jridgewell/resolve-uri': 3.1.1 + '@jridgewell/sourcemap-codec': 1.4.15 + dev: true + /@manypkg/find-root@1.1.0: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: @@ -2011,6 +2034,22 @@ packages: tslib: 2.6.2 dev: false + /@tsconfig/node10@1.0.11: + resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} + dev: true + + /@tsconfig/node12@1.0.11: + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + dev: true + + /@tsconfig/node14@1.0.3: + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + dev: true + + /@tsconfig/node16@1.0.4: + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + dev: true + /@types/body-parser@1.19.5: resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} dependencies: @@ -2551,7 +2590,7 @@ packages: eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.29.0) eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.17.0)(eslint-plugin-import@2.29.0)(eslint@8.57.0) eslint-plugin-eslint-comments: 3.2.0(eslint@8.57.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.1.0)(eslint@8.57.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-jest: 27.6.0(@typescript-eslint/eslint-plugin@6.17.0)(eslint@8.57.0)(typescript@5.3.3) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-playwright: 0.16.0(eslint-plugin-jest@27.6.0)(eslint@8.57.0) @@ -2727,6 +2766,10 @@ packages: normalize-path: 3.0.0 picomatch: 2.3.1 + /arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + dev: true + /arg@5.0.2: resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} @@ -3252,6 +3295,10 @@ packages: engines: {node: '>= 0.6'} dev: false + /create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + dev: true + /cross-spawn@5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: @@ -3471,6 +3518,11 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true + /diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + dev: true + /digest-fetch@1.3.0: resolution: {integrity: sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA==} dependencies: @@ -3730,7 +3782,7 @@ packages: peerDependencies: eslint-plugin-import: '>=1.4.0' dependencies: - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.1.0)(eslint@8.57.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) dev: true /eslint-import-resolver-node@0.3.9: @@ -3753,8 +3805,8 @@ packages: debug: 4.3.4 enhanced-resolve: 5.15.0 eslint: 8.57.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.1.0)(eslint@8.57.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) fast-glob: 3.3.1 get-tsconfig: 4.7.2 is-core-module: 2.13.1 @@ -3766,7 +3818,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -3790,36 +3842,8 @@ packages: '@typescript-eslint/parser': 6.17.0(eslint@8.57.0)(typescript@5.3.3) debug: 3.2.7 eslint: 8.57.0 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.17.0)(eslint-plugin-import@2.29.0)(eslint@8.57.0) - transitivePeerDependencies: - - supports-color - dev: true - - /eslint-module-utils@2.8.0(@typescript-eslint/parser@7.1.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): - resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} - engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: '*' - eslint-import-resolver-node: '*' - eslint-import-resolver-typescript: '*' - eslint-import-resolver-webpack: '*' - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - eslint: - optional: true - eslint-import-resolver-node: - optional: true - eslint-import-resolver-typescript: - optional: true - eslint-import-resolver-webpack: - optional: true - dependencies: - '@typescript-eslint/parser': 7.1.0(eslint@8.57.0)(typescript@5.3.3) - debug: 3.2.7 - eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.17.0)(eslint-plugin-import@2.29.0)(eslint@8.57.0) transitivePeerDependencies: - supports-color dev: true @@ -3835,7 +3859,7 @@ packages: ignore: 5.3.1 dev: true - /eslint-plugin-import@2.29.0(@typescript-eslint/parser@7.1.0)(eslint@8.57.0): + /eslint-plugin-import@2.29.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): resolution: {integrity: sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==} engines: {node: '>=4'} peerDependencies: @@ -3845,7 +3869,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 7.1.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.17.0(eslint@8.57.0)(typescript@5.3.3) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -3854,7 +3878,7 @@ packages: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.1.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -5342,6 +5366,10 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true + /make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + dev: true + /map-obj@1.0.1: resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} engines: {node: '>=0.10.0'} @@ -7119,6 +7147,37 @@ packages: typescript: 5.3.3 dev: false + /ts-node@10.9.2(@types/node@20.11.24)(typescript@5.3.3): + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + 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 + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 20.11.24 + acorn: 8.11.3 + acorn-walk: 8.3.2 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.3.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true + /tsconfig-paths@3.14.2: resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==} dependencies: @@ -7159,64 +7218,64 @@ packages: yargs: 17.7.2 dev: true - /turbo-darwin-64@1.13.2: - resolution: {integrity: sha512-CCSuD8CfmtncpohCuIgq7eAzUas0IwSbHfI8/Q3vKObTdXyN8vAo01gwqXjDGpzG9bTEVedD0GmLbD23dR0MLA==} + /turbo-darwin-64@1.13.0: + resolution: {integrity: sha512-ctHeJXtQgBcgxnCXwrJTGiq57HtwF7zWz5NTuSv//5yeU01BtQIt62ArKfjudOhRefWJbX3Z5srn88XTb9hfww==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-darwin-arm64@1.13.2: - resolution: {integrity: sha512-0HySm06/D2N91rJJ89FbiI/AodmY8B3WDSFTVEpu2+8spUw7hOJ8okWOT0e5iGlyayUP9gr31eOeL3VFZkpfCw==} + /turbo-darwin-arm64@1.13.0: + resolution: {integrity: sha512-/Q9/pNFkF9w83tNxwMpgapwLYdQ12p8mpty2YQRoUiS9ClWkcqe136jR0mtuMqzlNlpREOFZaoyIthjt6Sdo0g==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-linux-64@1.13.2: - resolution: {integrity: sha512-7HnibgbqZrjn4lcfIouzlPu8ZHSBtURG4c7Bedu7WJUDeZo+RE1crlrQm8wuwO54S0siYqUqo7GNHxu4IXbioQ==} + /turbo-linux-64@1.13.0: + resolution: {integrity: sha512-hgbT7o020BGV4L7Sd8hhFTd5zVKPKxbsr0dPfel/9NkdTmptz2aGZ0Vb2MAa18SY3XaCQpDxmdYuOzvvRpo5ZA==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm64@1.13.2: - resolution: {integrity: sha512-sUq4dbpk6SNKg/Hkwn256Vj2AEYSQdG96repio894h5/LEfauIK2QYiC/xxAeW3WBMc6BngmvNyURIg7ltrePg==} + /turbo-linux-arm64@1.13.0: + resolution: {integrity: sha512-WK01i2wDZARrV+HEs495A3hNeGMwQR5suYk7G+ceqqW7b+dOTlQdvUjnI3sg7wAnZPgjafFs/hoBaZdJjVa/nw==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-windows-64@1.13.2: - resolution: {integrity: sha512-DqzhcrciWq3dpzllJR2VVIyOhSlXYCo4mNEWl98DJ3FZ08PEzcI3ceudlH6F0t/nIcfSItK1bDP39cs7YoZHEA==} + /turbo-windows-64@1.13.0: + resolution: {integrity: sha512-hJgSZJZwlWHNwLEthaqJqJWGm4NqF5X/I7vE0sPE4i/jeDl8f0n1hcOkgJkJiNXVxhj+qy/9+4dzbPLKT9imaQ==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-arm64@1.13.2: - resolution: {integrity: sha512-WnPMrwfCXxK69CdDfS1/j2DlzcKxSmycgDAqV0XCYpK/812KB0KlvsVAt5PjEbZGXkY88pCJ1BLZHAjF5FcbqA==} + /turbo-windows-arm64@1.13.0: + resolution: {integrity: sha512-L/ErxYoXeq8tmjU/AIGicC9VyBN1zdYw8JlM4yPmMI0pJdY8E4GaYK1IiIazqq7M72lmQhU/WW7fV9FqEktwrw==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /turbo@1.13.2: - resolution: {integrity: sha512-rX/d9f4MgRT3yK6cERPAkfavIxbpBZowDQpgvkYwGMGDQ0Nvw1nc0NVjruE76GrzXQqoxR1UpnmEP54vBARFHQ==} + /turbo@1.13.0: + resolution: {integrity: sha512-r02GtNmkOPcQvUzVE6lg474QVLyU02r3yh3lUGqrFHf5h5ZEjgDGWILsAUqplVqjri1Y/oOkTssks4CObTAaiw==} hasBin: true optionalDependencies: - turbo-darwin-64: 1.13.2 - turbo-darwin-arm64: 1.13.2 - turbo-linux-64: 1.13.2 - turbo-linux-arm64: 1.13.2 - turbo-windows-64: 1.13.2 - turbo-windows-arm64: 1.13.2 + turbo-darwin-64: 1.13.0 + turbo-darwin-arm64: 1.13.0 + turbo-linux-64: 1.13.0 + turbo-linux-arm64: 1.13.0 + turbo-windows-64: 1.13.0 + turbo-windows-arm64: 1.13.0 dev: true /turbowatch@2.29.4: @@ -7440,6 +7499,10 @@ packages: engines: {node: '>= 0.4.0'} dev: false + /v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + dev: true + /validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} dependencies: @@ -7781,6 +7844,11 @@ packages: yargs-parser: 21.1.1 dev: true + /yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + dev: true + /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -7832,3 +7900,7 @@ packages: which: 3.0.1 yaml: 2.4.1 dev: true + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false diff --git a/turbo/generators/templates/package/library/package.json.hbs b/turbo/generators/templates/package/library/package.json.hbs index 227aa4ba..4a8f5963 100644 --- a/turbo/generators/templates/package/library/package.json.hbs +++ b/turbo/generators/templates/package/library/package.json.hbs @@ -7,7 +7,7 @@ "type": "git", "url": "https://github.com/empirical-run/empirical.git" }, - "author": "Empirical.run Team ", + "author": "Empirical Team ", "scripts": { "build": "tsc --build", "clean": "tsc --build --clean", From ab79c741b3bdeaca226ba93870af5b391a986506 Mon Sep 17 00:00:00 2001 From: Saikat Mitra Date: Tue, 9 Apr 2024 01:20:38 +0530 Subject: [PATCH 3/4] fix: build error --- pnpm-lock.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 61047085..9b0b5172 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -270,13 +270,13 @@ importers: packages/json-schema: dependencies: - '@types/node': - specifier: ^20.11.24 - version: 20.11.24 ts-json-schema-generator: specifier: ^1.5.0 version: 1.5.0 devDependencies: + '@types/node': + specifier: ^20.11.24 + version: 20.11.24 ts-node: specifier: ^10.9.2 version: 10.9.2(@types/node@20.11.24)(typescript@5.3.3) From 9e23fdc964464a65fc7daecc4c19b2924ef0990d Mon Sep 17 00:00:00 2001 From: Saikat Mitra Date: Tue, 9 Apr 2024 01:24:43 +0530 Subject: [PATCH 4/4] fix: package dependencies --- package.json | 6 +----- pnpm-lock.yaml | 46 +++++++++++++++++++++------------------------- 2 files changed, 22 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 410dccf3..b05a962c 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,7 @@ "test": "turbo test", "test:watch": "turbo run test:watch", "publish-packages": "changeset publish", - "changeset": "changeset", - "generate:schema": "turbo schema" + "changeset": "changeset" }, "devDependencies": { "@changesets/cli": "^2.27.1", @@ -28,8 +27,5 @@ "packageManager": "pnpm@8.5.0", "engines": { "node": ">=20" - }, - "dependencies": { - "ts-json-schema-generator": "^1.5.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9b0b5172..2f055c0b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3,10 +3,6 @@ lockfileVersion: '6.0' importers: .: - dependencies: - ts-json-schema-generator: - specifier: ^1.5.0 - version: 1.5.0 devDependencies: '@changesets/cli': specifier: ^2.27.1 @@ -28,7 +24,7 @@ importers: version: 3.4.1 turbo: specifier: latest - version: 1.13.0 + version: 1.13.2 turbowatch: specifier: ^2.29.4 version: 2.29.4 @@ -7218,64 +7214,64 @@ packages: yargs: 17.7.2 dev: true - /turbo-darwin-64@1.13.0: - resolution: {integrity: sha512-ctHeJXtQgBcgxnCXwrJTGiq57HtwF7zWz5NTuSv//5yeU01BtQIt62ArKfjudOhRefWJbX3Z5srn88XTb9hfww==} + /turbo-darwin-64@1.13.2: + resolution: {integrity: sha512-CCSuD8CfmtncpohCuIgq7eAzUas0IwSbHfI8/Q3vKObTdXyN8vAo01gwqXjDGpzG9bTEVedD0GmLbD23dR0MLA==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-darwin-arm64@1.13.0: - resolution: {integrity: sha512-/Q9/pNFkF9w83tNxwMpgapwLYdQ12p8mpty2YQRoUiS9ClWkcqe136jR0mtuMqzlNlpREOFZaoyIthjt6Sdo0g==} + /turbo-darwin-arm64@1.13.2: + resolution: {integrity: sha512-0HySm06/D2N91rJJ89FbiI/AodmY8B3WDSFTVEpu2+8spUw7hOJ8okWOT0e5iGlyayUP9gr31eOeL3VFZkpfCw==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-linux-64@1.13.0: - resolution: {integrity: sha512-hgbT7o020BGV4L7Sd8hhFTd5zVKPKxbsr0dPfel/9NkdTmptz2aGZ0Vb2MAa18SY3XaCQpDxmdYuOzvvRpo5ZA==} + /turbo-linux-64@1.13.2: + resolution: {integrity: sha512-7HnibgbqZrjn4lcfIouzlPu8ZHSBtURG4c7Bedu7WJUDeZo+RE1crlrQm8wuwO54S0siYqUqo7GNHxu4IXbioQ==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm64@1.13.0: - resolution: {integrity: sha512-WK01i2wDZARrV+HEs495A3hNeGMwQR5suYk7G+ceqqW7b+dOTlQdvUjnI3sg7wAnZPgjafFs/hoBaZdJjVa/nw==} + /turbo-linux-arm64@1.13.2: + resolution: {integrity: sha512-sUq4dbpk6SNKg/Hkwn256Vj2AEYSQdG96repio894h5/LEfauIK2QYiC/xxAeW3WBMc6BngmvNyURIg7ltrePg==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-windows-64@1.13.0: - resolution: {integrity: sha512-hJgSZJZwlWHNwLEthaqJqJWGm4NqF5X/I7vE0sPE4i/jeDl8f0n1hcOkgJkJiNXVxhj+qy/9+4dzbPLKT9imaQ==} + /turbo-windows-64@1.13.2: + resolution: {integrity: sha512-DqzhcrciWq3dpzllJR2VVIyOhSlXYCo4mNEWl98DJ3FZ08PEzcI3ceudlH6F0t/nIcfSItK1bDP39cs7YoZHEA==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-arm64@1.13.0: - resolution: {integrity: sha512-L/ErxYoXeq8tmjU/AIGicC9VyBN1zdYw8JlM4yPmMI0pJdY8E4GaYK1IiIazqq7M72lmQhU/WW7fV9FqEktwrw==} + /turbo-windows-arm64@1.13.2: + resolution: {integrity: sha512-WnPMrwfCXxK69CdDfS1/j2DlzcKxSmycgDAqV0XCYpK/812KB0KlvsVAt5PjEbZGXkY88pCJ1BLZHAjF5FcbqA==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /turbo@1.13.0: - resolution: {integrity: sha512-r02GtNmkOPcQvUzVE6lg474QVLyU02r3yh3lUGqrFHf5h5ZEjgDGWILsAUqplVqjri1Y/oOkTssks4CObTAaiw==} + /turbo@1.13.2: + resolution: {integrity: sha512-rX/d9f4MgRT3yK6cERPAkfavIxbpBZowDQpgvkYwGMGDQ0Nvw1nc0NVjruE76GrzXQqoxR1UpnmEP54vBARFHQ==} hasBin: true optionalDependencies: - turbo-darwin-64: 1.13.0 - turbo-darwin-arm64: 1.13.0 - turbo-linux-64: 1.13.0 - turbo-linux-arm64: 1.13.0 - turbo-windows-64: 1.13.0 - turbo-windows-arm64: 1.13.0 + turbo-darwin-64: 1.13.2 + turbo-darwin-arm64: 1.13.2 + turbo-linux-64: 1.13.2 + turbo-linux-arm64: 1.13.2 + turbo-windows-64: 1.13.2 + turbo-windows-arm64: 1.13.2 dev: true /turbowatch@2.29.4: