From f2a09f650b8a17b86640b5b2a3450e426246f848 Mon Sep 17 00:00:00 2001 From: skdhg <46562212+skdhg@users.noreply.github.com> Date: Fri, 8 Dec 2023 00:14:33 +0545 Subject: [PATCH 1/2] wip fast refresh --- package.json | 3 +- .../commandkit/bin/dependency-tracker.mjs | 9 + packages/commandkit/bin/development.mjs | 12 +- packages/commandkit/bin/watcher.mjs | 9 + packages/commandkit/package.json | 2 + pnpm-lock.yaml | 287 +++++++++++++++++- 6 files changed, 313 insertions(+), 9 deletions(-) create mode 100644 packages/commandkit/bin/dependency-tracker.mjs create mode 100644 packages/commandkit/bin/watcher.mjs diff --git a/package.json b/package.json index d35d69a..6d30b8c 100644 --- a/package.json +++ b/package.json @@ -15,5 +15,6 @@ "devDependencies": { "prettier": "^3.0.3", "turbo": "^1.10.13" - } + }, + "packageManager": "pnpm@8.11.0+sha256.5858806c3b292cbec89b5533662168a957358e2bbd86431516d441dc1aface89" } diff --git a/packages/commandkit/bin/dependency-tracker.mjs b/packages/commandkit/bin/dependency-tracker.mjs new file mode 100644 index 0000000..0af17bf --- /dev/null +++ b/packages/commandkit/bin/dependency-tracker.mjs @@ -0,0 +1,9 @@ +// @ts-check + +import { paperwork } from 'precinct' + +export function getDependencies(file) { + return paperwork(file, { + includeCore: false + }) +} \ No newline at end of file diff --git a/packages/commandkit/bin/development.mjs b/packages/commandkit/bin/development.mjs index df35e55..74c217e 100644 --- a/packages/commandkit/bin/development.mjs +++ b/packages/commandkit/bin/development.mjs @@ -6,6 +6,8 @@ import { Colors, erase, findCommandKitConfig, panic, write } from './common.mjs' import { parseEnv } from './parse-env.mjs'; import child_process from 'node:child_process'; import ora from 'ora'; +import { watchFiles } from './watcher.mjs'; +import { getDependencies } from './dependency-tracker.mjs'; const RESTARTING_MSG_PATTERN = /^Restarting '|".+'|"\n?$/; const FAILED_RUNNING_PATTERN = /^Failed running '.+'|"\n?$/; @@ -33,11 +35,11 @@ export async function bootstrapDevelopmentServer(opts) { const status = ora(Colors.green('Starting a development server...\n')).start(); const start = performance.now(); - if (watchMode && !nodeOptions.includes('--watch')) { - nodeOptions.push('--watch'); - } else if (!watchMode && nodeOptions.includes('--watch')) { - nodeOptions.splice(nodeOptions.indexOf('--watch'), 1); - } + // if (watchMode && !nodeOptions.includes('--watch')) { + // nodeOptions.push('--watch'); + // } else if (!watchMode && nodeOptions.includes('--watch')) { + // nodeOptions.splice(nodeOptions.indexOf('--watch'), 1); + // } if (!nodeOptions.includes('--enable-source-maps')) { nodeOptions.push('--enable-source-maps'); diff --git a/packages/commandkit/bin/watcher.mjs b/packages/commandkit/bin/watcher.mjs new file mode 100644 index 0000000..76474bc --- /dev/null +++ b/packages/commandkit/bin/watcher.mjs @@ -0,0 +1,9 @@ +// @ts-check + +import { watch } from 'chokidar' + +export function watchFiles(target, callback) { + const watcher = watch(target); + + return watcher.on('all', callback); +} \ No newline at end of file diff --git a/packages/commandkit/package.json b/packages/commandkit/package.json index d6fa7ea..e86d5c8 100644 --- a/packages/commandkit/package.json +++ b/packages/commandkit/package.json @@ -38,8 +38,10 @@ "event handler" ], "dependencies": { + "chokidar": "^3.5.3", "commander": "^11.1.0", "ora": "^7.0.1", + "precinct": "^11.0.5", "rfdc": "^1.3.0", "rimraf": "^5.0.5", "tsup": "^7.2.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ff21db1..6554c64 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,12 +56,18 @@ importers: packages/commandkit: dependencies: + chokidar: + specifier: ^3.5.3 + version: 3.5.3 commander: specifier: ^11.1.0 version: 11.1.0 ora: specifier: ^7.0.1 version: 7.0.1 + precinct: + specifier: ^11.0.5 + version: 11.0.5 rfdc: specifier: ^1.3.0 version: 1.3.0 @@ -70,7 +76,7 @@ importers: version: 5.0.5 tsup: specifier: ^7.2.0 - version: 7.2.0(typescript@5.2.2) + version: 7.2.0(postcss@8.4.31)(typescript@5.2.2) devDependencies: '@types/node': specifier: ^20.5.9 @@ -100,6 +106,24 @@ packages: engines: {node: '>=10'} dev: false + /@babel/helper-string-parser@7.23.4: + resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} + engines: {node: '>=6.9.0'} + dev: false + + /@babel/helper-validator-identifier@7.22.20: + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + engines: {node: '>=6.9.0'} + dev: false + + /@babel/parser@7.23.5: + resolution: {integrity: sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.23.5 + dev: false + /@babel/runtime@7.22.15: resolution: {integrity: sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==} engines: {node: '>=6.9.0'} @@ -107,10 +131,27 @@ packages: regenerator-runtime: 0.14.0 dev: false + /@babel/types@7.23.5: + resolution: {integrity: sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + dev: false + /@braintree/sanitize-url@6.0.4: resolution: {integrity: sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==} dev: false + /@dependents/detective-less@4.1.0: + resolution: {integrity: sha512-KrkT6qO5NxqNfy68sBl6CTSoJ4SNDIS5iQArkibhlbGU4LaDukZ3q2HIkh8aUKDio6o4itU4xDR7t82Y2eP1Bg==} + engines: {node: '>=14'} + dependencies: + gonzales-pe: 4.3.0 + node-source-walk: 6.0.2 + dev: false + /@discordjs/builders@1.6.5: resolution: {integrity: sha512-SdweyCs/+mHj+PNhGLLle7RrRFX9ZAhzynHahMCLqp5Zeq7np7XC6/mgzHc79QoVlQ1zZtOkTTiJpOZu5V8Ufg==} engines: {node: '>=16.11.0'} @@ -854,6 +895,40 @@ packages: '@types/node': 20.6.3 dev: true + /@typescript-eslint/types@5.62.0: + resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: false + + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.2.2): + resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/visitor-keys': 5.62.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.4 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/visitor-keys@5.62.0: + resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.62.0 + eslint-visitor-keys: 3.4.3 + dev: false + /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: false @@ -949,6 +1024,11 @@ packages: engines: {node: '>=8'} dev: false + /ast-module-types@5.0.0: + resolution: {integrity: sha512-JvqziE0Wc0rXQfma0HZC/aY7URXHFuZV84fJRtP8u+lhp0JYCNd5wJzVXP45t0PH0Mej3ynlzvdyITYIu0G4LQ==} + engines: {node: '>=14'} + dev: false + /astring@1.8.6: resolution: {integrity: sha512-ISvCdHdlTDlH5IpxQJIex7BWBywFWgjJSVdwst+/iQCoEYnyOaQ95+X1JGshuBjGp6nxKUy1jMgE3zPqN7fQdg==} hasBin: true @@ -1170,6 +1250,11 @@ packages: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} dev: false + /commander@10.0.1: + resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} + engines: {node: '>=14'} + dev: false + /commander@11.1.0: resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} engines: {node: '>=16'} @@ -1574,6 +1659,74 @@ packages: engines: {node: '>=6'} dev: false + /detective-amd@5.0.2: + resolution: {integrity: sha512-XFd/VEQ76HSpym80zxM68ieB77unNuoMwopU2TFT/ErUk5n4KvUTwW4beafAVUugrjV48l4BmmR0rh2MglBaiA==} + engines: {node: '>=14'} + hasBin: true + dependencies: + ast-module-types: 5.0.0 + escodegen: 2.1.0 + get-amd-module-type: 5.0.1 + node-source-walk: 6.0.2 + dev: false + + /detective-cjs@5.0.1: + resolution: {integrity: sha512-6nTvAZtpomyz/2pmEmGX1sXNjaqgMplhQkskq2MLrar0ZAIkHMrDhLXkRiK2mvbu9wSWr0V5/IfiTrZqAQMrmQ==} + engines: {node: '>=14'} + dependencies: + ast-module-types: 5.0.0 + node-source-walk: 6.0.2 + dev: false + + /detective-es6@4.0.1: + resolution: {integrity: sha512-k3Z5tB4LQ8UVHkuMrFOlvb3GgFWdJ9NqAa2YLUU/jTaWJIm+JJnEh4PsMc+6dfT223Y8ACKOaC0qcj7diIhBKw==} + engines: {node: '>=14'} + dependencies: + node-source-walk: 6.0.2 + dev: false + + /detective-postcss@6.1.3: + resolution: {integrity: sha512-7BRVvE5pPEvk2ukUWNQ+H2XOq43xENWbH0LcdCE14mwgTBEAMoAx+Fc1rdp76SmyZ4Sp48HlV7VedUnP6GA1Tw==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dependencies: + is-url: 1.2.4 + postcss: 8.4.31 + postcss-values-parser: 6.0.2(postcss@8.4.31) + dev: false + + /detective-sass@5.0.3: + resolution: {integrity: sha512-YsYT2WuA8YIafp2RVF5CEfGhhyIVdPzlwQgxSjK+TUm3JoHP+Tcorbk3SfG0cNZ7D7+cYWa0ZBcvOaR0O8+LlA==} + engines: {node: '>=14'} + dependencies: + gonzales-pe: 4.3.0 + node-source-walk: 6.0.2 + dev: false + + /detective-scss@4.0.3: + resolution: {integrity: sha512-VYI6cHcD0fLokwqqPFFtDQhhSnlFWvU614J42eY6G0s8c+MBhi9QAWycLwIOGxlmD8I/XvGSOUV1kIDhJ70ZPg==} + engines: {node: '>=14'} + dependencies: + gonzales-pe: 4.3.0 + node-source-walk: 6.0.2 + dev: false + + /detective-stylus@4.0.0: + resolution: {integrity: sha512-TfPotjhszKLgFBzBhTOxNHDsutIxx9GTWjrL5Wh7Qx/ydxKhwUrlSFeLIn+ZaHPF+h0siVBkAQSuy6CADyTxgQ==} + engines: {node: '>=14'} + dev: false + + /detective-typescript@11.1.0: + resolution: {integrity: sha512-Mq8egjnW2NSCkzEb/Az15/JnBI/Ryyl6Po0Y+0mABTFvOS6DAyUGRZqz1nyhu4QJmWWe0zaGs/ITIBeWkvCkGw==} + engines: {node: ^14.14.0 || >=16.0.0} + dependencies: + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) + ast-module-types: 5.0.0 + node-source-walk: 6.0.2 + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: false + /devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} dependencies: @@ -1709,12 +1862,34 @@ packages: engines: {node: '>=12'} dev: false + /escodegen@2.1.0: + resolution: {integrity: sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==} + engines: {node: '>=6.0'} + hasBin: true + dependencies: + esprima: 4.0.1 + estraverse: 5.3.0 + esutils: 2.0.3 + optionalDependencies: + source-map: 0.6.1 + dev: false + + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: false + /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true dev: false + /estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + dev: false + /estree-util-attach-comments@2.1.1: resolution: {integrity: sha512-+5Ba/xGGS6mnwFbXIuQiDPTbuTxuMCooq3arVv7gPZtYpjp+VXH/NkHAP35OOefPhNG/UGqU3vt/LTABwcHX0w==} dependencies: @@ -1761,6 +1936,11 @@ packages: '@types/estree': 1.0.1 dev: false + /esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: false + /execa@0.8.0: resolution: {integrity: sha512-zDWS+Rb1E8BlqqhALSt9kUhss8Qq4nN3iof3gsOdyINksElaPyNBtKUMTR62qhvgVWR0CqCX7sdnKe4MnUbFEA==} engines: {node: '>=4'} @@ -1863,6 +2043,14 @@ packages: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} dev: false + /get-amd-module-type@5.0.1: + resolution: {integrity: sha512-jb65zDeHyDjFR1loOVk0HQGM5WNwoGB8aLWy3LKCieMKol0/ProHkhO2X1JxojuN10vbz1qNn09MJ7tNp7qMzw==} + engines: {node: '>=14'} + dependencies: + ast-module-types: 5.0.0 + node-source-walk: 6.0.2 + dev: false + /get-stream@3.0.0: resolution: {integrity: sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==} engines: {node: '>=4'} @@ -1949,6 +2137,14 @@ packages: slash: 3.0.0 dev: false + /gonzales-pe@4.3.0: + resolution: {integrity: sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==} + engines: {node: '>=0.6.0'} + hasBin: true + dependencies: + minimist: 1.2.8 + dev: false + /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: false @@ -2307,6 +2503,15 @@ packages: engines: {node: '>=12'} dev: false + /is-url-superb@4.0.0: + resolution: {integrity: sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA==} + engines: {node: '>=10'} + dev: false + + /is-url@1.2.4: + resolution: {integrity: sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==} + dev: false + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: false @@ -3117,11 +3322,24 @@ packages: brace-expansion: 2.0.1 dev: false + /minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: false + /minipass@7.0.4: resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} engines: {node: '>=16 || 14 >=14.17'} dev: false + /module-definition@5.0.1: + resolution: {integrity: sha512-kvw3B4G19IXk+BOXnYq/D/VeO9qfHaapMeuS7w7sNUqmGaA6hywdFHMi+VWeR9wUScXM7XjoryTffCZ5B0/8IA==} + engines: {node: '>=14'} + hasBin: true + dependencies: + ast-module-types: 5.0.0 + node-source-walk: 6.0.2 + dev: false + /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -3298,6 +3516,13 @@ packages: resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} dev: false + /node-source-walk@6.0.2: + resolution: {integrity: sha512-jn9vOIK/nfqoFCcpK89/VCVaLg1IHE6UVfDOzvqmANaJ/rWCTEdH8RZ1V278nv2jr36BJdyQXIAavBLXpzdlag==} + engines: {node: '>=14'} + dependencies: + '@babel/parser': 7.23.5 + dev: false + /non-layered-tidy-tree-layout@2.0.2: resolution: {integrity: sha512-gkXMxRzUH+PB0ax9dUN0yYF0S25BqeAYqhgMaLUFmpXLEk7Fcu8f4emJuOAY0V8kjDICxROIKsTAKsV/v355xw==} dev: false @@ -3536,6 +3761,18 @@ packages: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} dev: false + /postcss-values-parser@6.0.2(postcss@8.4.31): + resolution: {integrity: sha512-YLJpK0N1brcNJrs9WatuJFtHaV9q5aAOj+S4DI5S7jgHlRfm0PIbDCAFRYMQD5SHq7Fy6xsDhyutgS0QOAs0qw==} + engines: {node: '>=10'} + peerDependencies: + postcss: ^8.2.9 + dependencies: + color-name: 1.1.4 + is-url-superb: 4.0.0 + postcss: 8.4.31 + quote-unquote: 1.0.0 + dev: false + /postcss@8.4.14: resolution: {integrity: sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==} engines: {node: ^10 || ^12 || >=14} @@ -3554,6 +3791,27 @@ packages: source-map-js: 1.0.2 dev: false + /precinct@11.0.5: + resolution: {integrity: sha512-oHSWLC8cL/0znFhvln26D14KfCQFFn4KOLSw6hmLhd+LQ2SKt9Ljm89but76Pc7flM9Ty1TnXyrA2u16MfRV3w==} + engines: {node: ^14.14.0 || >=16.0.0} + hasBin: true + dependencies: + '@dependents/detective-less': 4.1.0 + commander: 10.0.1 + detective-amd: 5.0.2 + detective-cjs: 5.0.1 + detective-es6: 4.0.1 + detective-postcss: 6.1.3 + detective-sass: 5.0.3 + detective-scss: 4.0.3 + detective-stylus: 4.0.0 + detective-typescript: 11.1.0 + module-definition: 5.0.1 + node-source-walk: 6.0.2 + transitivePeerDependencies: + - supports-color + dev: false + /prettier@3.0.3: resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} engines: {node: '>=14'} @@ -3581,6 +3839,10 @@ packages: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: false + /quote-unquote@1.0.0: + resolution: {integrity: sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==} + dev: false + /react-dom@18.2.0(react@18.2.0): resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} peerDependencies: @@ -3897,7 +4159,6 @@ packages: /source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} - dev: true /source-map@0.7.4: resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} @@ -4111,6 +4372,11 @@ packages: engines: {node: '>=0.10.0'} dev: false + /to-fast-properties@2.0.0: + resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} + engines: {node: '>=4'} + dev: false + /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -4150,10 +4416,14 @@ packages: resolution: {integrity: sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ==} dev: true + /tslib@1.14.1: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + dev: false + /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - /tsup@7.2.0(typescript@5.2.2): + /tsup@7.2.0(postcss@8.4.31)(typescript@5.2.2): resolution: {integrity: sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ==} engines: {node: '>=16.14'} hasBin: true @@ -4177,6 +4447,7 @@ packages: execa: 5.1.1 globby: 11.1.0 joycon: 3.1.1 + postcss: 8.4.31 postcss-load-config: 4.0.1(postcss@8.4.31) resolve-from: 5.0.0 rollup: 3.29.2 @@ -4189,6 +4460,16 @@ packages: - ts-node dev: false + /tsutils@3.21.0(typescript@5.2.2): + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + 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' + dependencies: + tslib: 1.14.1 + typescript: 5.2.2 + dev: false + /tsx@3.12.10: resolution: {integrity: sha512-2+46h4xvUt1aLDNvk5YBT8Uzw+b7BolGbn7iSMucYqCXZiDc+1IMghLVdw8kKjING32JFOeO+Am9posvjkeclA==} hasBin: true From d7fc569b3c1ff2a733c6a5f0fedec503328b0528 Mon Sep 17 00:00:00 2001 From: twlite <46562212+twlite@users.noreply.github.com> Date: Sat, 30 Dec 2023 17:02:21 +0545 Subject: [PATCH 2/2] wip --- packages/commandkit/bin/common.mjs | 24 +- .../commandkit/bin/dependency-tracker.mjs | 9 - packages/commandkit/bin/development.mjs | 257 +++++++++++------ packages/commandkit/package.json | 2 +- packages/commandkit/src/CommandKit.ts | 59 ++++ packages/commandkit/src/index.ts | 2 + packages/commandkit/tsconfig.json | 4 +- pnpm-lock.yaml | 260 +----------------- 8 files changed, 272 insertions(+), 345 deletions(-) delete mode 100644 packages/commandkit/bin/dependency-tracker.mjs diff --git a/packages/commandkit/bin/common.mjs b/packages/commandkit/bin/common.mjs index d717fd1..628ff4a 100644 --- a/packages/commandkit/bin/common.mjs +++ b/packages/commandkit/bin/common.mjs @@ -58,6 +58,17 @@ export function findPackageJSON() { return JSON.parse(fs.readFileSync(target, 'utf8')); } +export function findTsconfig() { + const cwd = process.cwd(); + const target = join(cwd, 'tsconfig.json'); + + if (!fs.existsSync(target)) { + return null; + } + + return target; +} + const possibleFileNames = [ 'commandkit.json', 'commandkit.config.json', @@ -69,24 +80,29 @@ const possibleFileNames = [ 'commandkit.config.cjs', ]; -export async function findCommandKitConfig(src) { + +export async function findCommandKitConfig(src, skipLoad = false) { const cwd = process.cwd(); const locations = src ? [join(cwd, src)] : possibleFileNames.map((name) => join(cwd, name)); for (const location of locations) { try { - return await loadConfigInner(location); + const conf = await loadConfigInner(location, skipLoad); + if (!conf) continue; + return conf; } catch (e) { continue; } } - + if (skipLoad) return null; panic('Could not locate commandkit config.'); } -async function loadConfigInner(target) { +async function loadConfigInner(target, skipLoad = false) { const isJSON = target.endsWith('.json'); + if (skipLoad) return fs.existsSync(target) ? target : null; + /** * @type {import('..').CommandKitConfig} */ diff --git a/packages/commandkit/bin/dependency-tracker.mjs b/packages/commandkit/bin/dependency-tracker.mjs deleted file mode 100644 index 0af17bf..0000000 --- a/packages/commandkit/bin/dependency-tracker.mjs +++ /dev/null @@ -1,9 +0,0 @@ -// @ts-check - -import { paperwork } from 'precinct' - -export function getDependencies(file) { - return paperwork(file, { - includeCore: false - }) -} \ No newline at end of file diff --git a/packages/commandkit/bin/development.mjs b/packages/commandkit/bin/development.mjs index 22e2088..e014c32 100644 --- a/packages/commandkit/bin/development.mjs +++ b/packages/commandkit/bin/development.mjs @@ -7,10 +7,35 @@ import { parseEnv } from './parse-env.mjs'; import child_process from 'node:child_process'; import ora from 'ora'; import { injectShims } from './build.mjs'; +import { CommandKit, CommandKitSignalType } from '../dist'; +import { watchFiles } from './watcher.mjs'; const RESTARTING_MSG_PATTERN = /^Restarting '|".+'|"\n?$/; const FAILED_RUNNING_PATTERN = /^Failed running '.+'|"\n?$/; +function readEnv(envExtra) { + const processEnv = {}; + const env = dotenv({ + path: join(process.cwd(), '.env'), + // @ts-expect-error + processEnv, + }); + + if (envExtra) { + parseEnv(processEnv); + } + + if (env.error) { + write(Colors.yellow(`[DOTENV] Warning: ${env.error.message}`)); + } + + if (env.parsed) { + write(Colors.blue('[DOTENV] Loaded .env file!')); + } + + return processEnv; +} + export async function bootstrapDevelopmentServer(opts) { const { src, @@ -47,6 +72,22 @@ export async function bootstrapDevelopmentServer(opts) { erase('.commandkit'); + let watchEmitted = false, serverProcess = null, watching = false; + const watchModeMetadata = { + didEventsChange: false, + didCommandsChange: false, + didValidatorsChange: false, + didOthersChange: false, + }; + + const knownPaths = { + commands: '', + events: '', + validators: '', + source: join(process.cwd(), src), + config: await findCommandKitConfig(opts.config, true) + }; + try { await build({ clean: true, @@ -61,107 +102,163 @@ export async function bootstrapDevelopmentServer(opts) { silent: true, entry: [src, '!dist', '!.commandkit', `!${outDir}`].filter(Boolean), watch: watchMode, - }); - - await injectShims('.commandkit', main, false, requirePolyfill); + async onSuccess() { + await injectShims('.commandkit', main, false, requirePolyfill); + status.succeed( + Colors.green(`Dev server started in ${(performance.now() - start).toFixed(2)}ms!\n`), + ); + const processEnv = readEnv(envExtra); + if (watchMode) { + if (!watchEmitted) { write(Colors.cyan('Watching for file changes...\n')); watchEmitted = true } + if (!watching) { + watchFiles(Object.values(knownPaths).filter(Boolean), (path) => { + watchModeMetadata.didCommandsChange = path === knownPaths.commands; + watchModeMetadata.didEventsChange = path === knownPaths.events; + watchModeMetadata.didValidatorsChange = path === knownPaths.validators; - status.succeed( - Colors.green(`Dev server started in ${(performance.now() - start).toFixed(2)}ms!\n`), - ); - - if (watchMode) write(Colors.cyan('Watching for file changes...\n')); - - const processEnv = {}; + watchModeMetadata.didOthersChange = [ + watchModeMetadata.didCommandsChange, + watchModeMetadata.didEventsChange, + watchModeMetadata.didValidatorsChange, + ].every(p => !p); + }); + watching = true; + } + } - const env = dotenv({ - path: join(process.cwd(), '.env'), - // @ts-expect-error - processEnv, + serverProcess = triggerRestart({ + serverProcess, + processEnv, + main, + nodeOptions, + clearRestartLogs, + ...watchModeMetadata, + }); + } }); + } catch (e) { + status.fail(`Error occurred after ${(performance.now() - start).toFixed(2)}ms!\n`); + panic(e.stack ?? e); + } +} - if (envExtra) { - parseEnv(processEnv); +async function triggerRestart({ + serverProcess, + processEnv, + main, + nodeOptions, + clearRestartLogs, + didEventsChange, + didCommandsChange, + didValidatorsChange, + didOthersChange +}) { + if (didOthersChange && serverProcess) { + serverProcess.kill(); + } else if (!didOthersChange && serverProcess) { + /** + * @type {import('node:child_process').ChildProcessWithoutNullStreams} + */ + const commandkit = serverProcess; + if (didEventsChange) { + commandkit.send(CommandKitSignalType.ReloadEvents); + write(Colors.cyan('⌀ Reloading events...')); } - if (env.error) { - write(Colors.yellow(`[DOTENV] Warning: ${env.error.message}`)); + if (didCommandsChange) { + commandkit.send(CommandKitSignalType.ReloadCommands); + write(Colors.cyan('⌀ Reloading commands...')); } - if (env.parsed) { - write(Colors.blue('[DOTENV] Loaded .env file!')); + if (didValidatorsChange) { + commandkit.send(CommandKitSignalType.ReloadValidations); + write(Colors.cyan('⌀ Reloading validators...')); } - /** - * @type {child_process.ChildProcessWithoutNullStreams} - */ - const ps = child_process.spawn( - 'node', - [...nodeOptions, join(process.cwd(), '.commandkit', main)], - { - env: { - ...process.env, - ...processEnv, - NODE_ENV: 'development', - // @ts-expect-error - COMMANDKIT_DEV: true, - // @ts-expect-error - COMMANDKIT_PRODUCTION: false, - }, - cwd: process.cwd(), + return serverProcess; + } + + return bootstrapNodeServer({ + main, + nodeOptions, + processEnv, + clearRestartLogs, + }); +} + +function bootstrapNodeServer({ + main, + nodeOptions, + processEnv, + clearRestartLogs, +}) { + /** + * @type {child_process.ChildProcessWithoutNullStreams} + */ + const ps = child_process.spawn( + 'node', + [...nodeOptions.filter(o => o !== '--watch'), join(process.cwd(), '.commandkit', main)], + { + env: { + ...process.env, + ...processEnv, + NODE_ENV: 'development', + COMMANDKIT_DEV: true, + COMMANDKIT_PRODUCTION: false, }, - ); + cwd: process.cwd(), + }, + ); - let isLastLogRestarting = false, - hasStarted = false; + let isLastLogRestarting = false, + hasStarted = false; - ps.stdout.on('data', (data) => { - const message = data.toString(); + ps.stdout.on('data', (data) => { + const message = data.toString(); - if (FAILED_RUNNING_PATTERN.test(message)) { - write(Colors.cyan('Failed running the bot, waiting for changes...')); - isLastLogRestarting = false; + if (FAILED_RUNNING_PATTERN.test(message)) { + write(Colors.cyan('Failed running the bot, waiting for changes...')); + isLastLogRestarting = false; + if (!hasStarted) hasStarted = true; + return; + } + + if (clearRestartLogs && !RESTARTING_MSG_PATTERN.test(message)) { + write(message); + isLastLogRestarting = false; + } else { + if (isLastLogRestarting || !hasStarted) { if (!hasStarted) hasStarted = true; return; } + write(Colors.cyan('⌀ Restarting the bot...')); + isLastLogRestarting = true; + } - if (clearRestartLogs && !RESTARTING_MSG_PATTERN.test(message)) { - write(message); - isLastLogRestarting = false; - } else { - if (isLastLogRestarting || !hasStarted) { - if (!hasStarted) hasStarted = true; - return; - } - write(Colors.cyan('⌀ Restarting the bot...')); - isLastLogRestarting = true; - } + if (!hasStarted) hasStarted = true; + }); - if (!hasStarted) hasStarted = true; - }); - - ps.stderr.on('data', (data) => { - const message = data.toString(); + ps.stderr.on('data', (data) => { + const message = data.toString(); - if ( - message.includes( - 'ExperimentalWarning: Watch mode is an experimental feature and might change at any time', - ) + if ( + message.includes( + 'ExperimentalWarning: Watch mode is an experimental feature and might change at any time', ) - return; + ) + return; - write(Colors.red(message)); - }); + write(Colors.red(message)); + }); - ps.on('close', (code) => { - write('\n'); - process.exit(code ?? 0); - }); + ps.on('close', (code) => { + write('\n'); + process.exit(code ?? 0); + }); - ps.on('error', (err) => { - panic(err); - }); - } catch (e) { - status.fail(`Error occurred after ${(performance.now() - start).toFixed(2)}ms!\n`); - panic(e.stack ?? e); - } -} + ps.on('error', (err) => { + panic(err); + }); + + return ps; +} \ No newline at end of file diff --git a/packages/commandkit/package.json b/packages/commandkit/package.json index 006b96a..3089b93 100644 --- a/packages/commandkit/package.json +++ b/packages/commandkit/package.json @@ -42,7 +42,7 @@ "commander": "^11.1.0", "dotenv": "^16.3.1", "ora": "^7.0.1", - "precinct": "^11.0.5", + "reflect-metadata": "^0.2.1", "rfdc": "^1.3.0", "rimraf": "^5.0.5", "tsup": "^7.2.0" diff --git a/packages/commandkit/src/CommandKit.ts b/packages/commandkit/src/CommandKit.ts index 87036f8..63c4935 100644 --- a/packages/commandkit/src/CommandKit.ts +++ b/packages/commandkit/src/CommandKit.ts @@ -5,6 +5,36 @@ import { CommandHandler, EventHandler, ValidationHandler } from './handlers'; import colors from './utils/colors'; +/** + * The IPC signals that CommandKit uses to communicate with the parent process. + */ +export const enum CommandKitSignalType { + /** + * Reload all commands. + */ + ReloadCommands = '__command$kit__reload_commands__', + /** + * Reload all events. + */ + ReloadEvents = '__command$kit__reload_events__', + /** + * Reload all validations. + */ + ReloadValidations = '__command$kit__reload_validations__', + /** + * Get the commands path. + */ + GetCommandsPath = '__command$kit__get_commands_path__', + /** + * Get the events path. + */ + GetEventsPath = '__command$kit__get_events_path__', + /** + * Get the validations path. + */ + GetValidationsPath = '__command$kit__get_validations_path__', +} + export class CommandKit { #data: CommandKitData; @@ -76,6 +106,35 @@ export class CommandKit { this.#data.commandHandler = commandHandler; } + + // + // skip if not in a child process + if (process.send) { + process.on('message', async (message) => { + switch (message) { + case CommandKitSignalType.ReloadCommands: + await this.reloadCommands(); + break; + case CommandKitSignalType.ReloadEvents: + await this.reloadEvents(); + break; + case CommandKitSignalType.ReloadValidations: + await this.reloadValidations(); + break; + case CommandKitSignalType.GetCommandsPath: + process.send!(message, this.commandsPath); + break; + case CommandKitSignalType.GetEventsPath: + process.send!(message, this.eventsPath); + break; + case CommandKitSignalType.GetValidationsPath: + process.send!(message, this.validationsPath); + break; + default: + break; + } + }); + } } /** diff --git a/packages/commandkit/src/index.ts b/packages/commandkit/src/index.ts index d6ba390..f4fdf25 100644 --- a/packages/commandkit/src/index.ts +++ b/packages/commandkit/src/index.ts @@ -1,3 +1,5 @@ +import 'reflect-metadata'; + export * from './CommandKit'; export * from './components'; export * from './config'; diff --git a/packages/commandkit/tsconfig.json b/packages/commandkit/tsconfig.json index 60bff6f..69c66ad 100644 --- a/packages/commandkit/tsconfig.json +++ b/packages/commandkit/tsconfig.json @@ -1,7 +1,9 @@ { "extends": "tsconfig/base.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "emitDecoratorMetadata": true, + "experimentalDecorators": true }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a09660..d3699fa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -68,9 +68,9 @@ importers: ora: specifier: ^7.0.1 version: 7.0.1 - precinct: - specifier: ^11.0.5 - version: 11.0.5 + reflect-metadata: + specifier: ^0.2.1 + version: 0.2.1 rfdc: specifier: ^1.3.0 version: 1.3.0 @@ -79,7 +79,7 @@ importers: version: 5.0.5 tsup: specifier: ^7.2.0 - version: 7.2.0(postcss@8.4.31)(typescript@5.2.2) + version: 7.2.0(typescript@5.2.2) devDependencies: '@types/node': specifier: ^20.5.9 @@ -113,27 +113,10 @@ packages: regenerator-runtime: 0.14.0 dev: false - /@babel/types@7.23.5: - resolution: {integrity: sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-string-parser': 7.23.4 - '@babel/helper-validator-identifier': 7.22.20 - to-fast-properties: 2.0.0 - dev: false - /@braintree/sanitize-url@6.0.4: resolution: {integrity: sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==} dev: false - /@dependents/detective-less@4.1.0: - resolution: {integrity: sha512-KrkT6qO5NxqNfy68sBl6CTSoJ4SNDIS5iQArkibhlbGU4LaDukZ3q2HIkh8aUKDio6o4itU4xDR7t82Y2eP1Bg==} - engines: {node: '>=14'} - dependencies: - gonzales-pe: 4.3.0 - node-source-walk: 6.0.2 - dev: false - /@discordjs/builders@1.6.5: resolution: {integrity: sha512-SdweyCs/+mHj+PNhGLLle7RrRFX9ZAhzynHahMCLqp5Zeq7np7XC6/mgzHc79QoVlQ1zZtOkTTiJpOZu5V8Ufg==} engines: {node: '>=16.11.0'} @@ -880,40 +863,6 @@ packages: '@types/node': 20.6.3 dev: true - /@typescript-eslint/types@5.62.0: - resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: false - - /@typescript-eslint/typescript-estree@5.62.0(typescript@5.2.2): - resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.5.4 - tsutils: 3.21.0(typescript@5.2.2) - typescript: 5.2.2 - transitivePeerDependencies: - - supports-color - dev: false - - /@typescript-eslint/visitor-keys@5.62.0: - resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.62.0 - eslint-visitor-keys: 3.4.3 - dev: false - /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: false @@ -1009,11 +958,6 @@ packages: engines: {node: '>=8'} dev: false - /ast-module-types@5.0.0: - resolution: {integrity: sha512-JvqziE0Wc0rXQfma0HZC/aY7URXHFuZV84fJRtP8u+lhp0JYCNd5wJzVXP45t0PH0Mej3ynlzvdyITYIu0G4LQ==} - engines: {node: '>=14'} - dev: false - /astring@1.8.6: resolution: {integrity: sha512-ISvCdHdlTDlH5IpxQJIex7BWBywFWgjJSVdwst+/iQCoEYnyOaQ95+X1JGshuBjGp6nxKUy1jMgE3zPqN7fQdg==} hasBin: true @@ -1235,11 +1179,6 @@ packages: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} dev: false - /commander@10.0.1: - resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} - engines: {node: '>=14'} - dev: false - /commander@11.1.0: resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} engines: {node: '>=16'} @@ -1644,74 +1583,6 @@ packages: engines: {node: '>=6'} dev: false - /detective-amd@5.0.2: - resolution: {integrity: sha512-XFd/VEQ76HSpym80zxM68ieB77unNuoMwopU2TFT/ErUk5n4KvUTwW4beafAVUugrjV48l4BmmR0rh2MglBaiA==} - engines: {node: '>=14'} - hasBin: true - dependencies: - ast-module-types: 5.0.0 - escodegen: 2.1.0 - get-amd-module-type: 5.0.1 - node-source-walk: 6.0.2 - dev: false - - /detective-cjs@5.0.1: - resolution: {integrity: sha512-6nTvAZtpomyz/2pmEmGX1sXNjaqgMplhQkskq2MLrar0ZAIkHMrDhLXkRiK2mvbu9wSWr0V5/IfiTrZqAQMrmQ==} - engines: {node: '>=14'} - dependencies: - ast-module-types: 5.0.0 - node-source-walk: 6.0.2 - dev: false - - /detective-es6@4.0.1: - resolution: {integrity: sha512-k3Z5tB4LQ8UVHkuMrFOlvb3GgFWdJ9NqAa2YLUU/jTaWJIm+JJnEh4PsMc+6dfT223Y8ACKOaC0qcj7diIhBKw==} - engines: {node: '>=14'} - dependencies: - node-source-walk: 6.0.2 - dev: false - - /detective-postcss@6.1.3: - resolution: {integrity: sha512-7BRVvE5pPEvk2ukUWNQ+H2XOq43xENWbH0LcdCE14mwgTBEAMoAx+Fc1rdp76SmyZ4Sp48HlV7VedUnP6GA1Tw==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - dependencies: - is-url: 1.2.4 - postcss: 8.4.31 - postcss-values-parser: 6.0.2(postcss@8.4.31) - dev: false - - /detective-sass@5.0.3: - resolution: {integrity: sha512-YsYT2WuA8YIafp2RVF5CEfGhhyIVdPzlwQgxSjK+TUm3JoHP+Tcorbk3SfG0cNZ7D7+cYWa0ZBcvOaR0O8+LlA==} - engines: {node: '>=14'} - dependencies: - gonzales-pe: 4.3.0 - node-source-walk: 6.0.2 - dev: false - - /detective-scss@4.0.3: - resolution: {integrity: sha512-VYI6cHcD0fLokwqqPFFtDQhhSnlFWvU614J42eY6G0s8c+MBhi9QAWycLwIOGxlmD8I/XvGSOUV1kIDhJ70ZPg==} - engines: {node: '>=14'} - dependencies: - gonzales-pe: 4.3.0 - node-source-walk: 6.0.2 - dev: false - - /detective-stylus@4.0.0: - resolution: {integrity: sha512-TfPotjhszKLgFBzBhTOxNHDsutIxx9GTWjrL5Wh7Qx/ydxKhwUrlSFeLIn+ZaHPF+h0siVBkAQSuy6CADyTxgQ==} - engines: {node: '>=14'} - dev: false - - /detective-typescript@11.1.0: - resolution: {integrity: sha512-Mq8egjnW2NSCkzEb/Az15/JnBI/Ryyl6Po0Y+0mABTFvOS6DAyUGRZqz1nyhu4QJmWWe0zaGs/ITIBeWkvCkGw==} - engines: {node: ^14.14.0 || >=16.0.0} - dependencies: - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) - ast-module-types: 5.0.0 - node-source-walk: 6.0.2 - typescript: 5.2.2 - transitivePeerDependencies: - - supports-color - dev: false - /devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} dependencies: @@ -1847,34 +1718,12 @@ packages: engines: {node: '>=12'} dev: false - /escodegen@2.1.0: - resolution: {integrity: sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==} - engines: {node: '>=6.0'} - hasBin: true - dependencies: - esprima: 4.0.1 - estraverse: 5.3.0 - esutils: 2.0.3 - optionalDependencies: - source-map: 0.6.1 - dev: false - - /eslint-visitor-keys@3.4.3: - resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: false - /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true dev: false - /estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} - dev: false - /estree-util-attach-comments@2.1.1: resolution: {integrity: sha512-+5Ba/xGGS6mnwFbXIuQiDPTbuTxuMCooq3arVv7gPZtYpjp+VXH/NkHAP35OOefPhNG/UGqU3vt/LTABwcHX0w==} dependencies: @@ -1921,11 +1770,6 @@ packages: '@types/estree': 1.0.5 dev: false - /esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - dev: false - /execa@0.8.0: resolution: {integrity: sha512-zDWS+Rb1E8BlqqhALSt9kUhss8Qq4nN3iof3gsOdyINksElaPyNBtKUMTR62qhvgVWR0CqCX7sdnKe4MnUbFEA==} engines: {node: '>=4'} @@ -2039,14 +1883,6 @@ packages: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} dev: false - /get-amd-module-type@5.0.1: - resolution: {integrity: sha512-jb65zDeHyDjFR1loOVk0HQGM5WNwoGB8aLWy3LKCieMKol0/ProHkhO2X1JxojuN10vbz1qNn09MJ7tNp7qMzw==} - engines: {node: '>=14'} - dependencies: - ast-module-types: 5.0.0 - node-source-walk: 6.0.2 - dev: false - /get-stream@3.0.0: resolution: {integrity: sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==} engines: {node: '>=4'} @@ -2133,14 +1969,6 @@ packages: slash: 3.0.0 dev: false - /gonzales-pe@4.3.0: - resolution: {integrity: sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==} - engines: {node: '>=0.6.0'} - hasBin: true - dependencies: - minimist: 1.2.8 - dev: false - /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: false @@ -2472,15 +2300,6 @@ packages: engines: {node: '>=12'} dev: false - /is-url-superb@4.0.0: - resolution: {integrity: sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA==} - engines: {node: '>=10'} - dev: false - - /is-url@1.2.4: - resolution: {integrity: sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==} - dev: false - /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: false @@ -3296,24 +3115,11 @@ packages: brace-expansion: 2.0.1 dev: false - /minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - dev: false - /minipass@7.0.4: resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} engines: {node: '>=16 || 14 >=14.17'} dev: false - /module-definition@5.0.1: - resolution: {integrity: sha512-kvw3B4G19IXk+BOXnYq/D/VeO9qfHaapMeuS7w7sNUqmGaA6hywdFHMi+VWeR9wUScXM7XjoryTffCZ5B0/8IA==} - engines: {node: '>=14'} - hasBin: true - dependencies: - ast-module-types: 5.0.0 - node-source-walk: 6.0.2 - dev: false - /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -3490,13 +3296,6 @@ packages: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} dev: false - /node-source-walk@6.0.2: - resolution: {integrity: sha512-jn9vOIK/nfqoFCcpK89/VCVaLg1IHE6UVfDOzvqmANaJ/rWCTEdH8RZ1V278nv2jr36BJdyQXIAavBLXpzdlag==} - engines: {node: '>=14'} - dependencies: - '@babel/parser': 7.23.5 - dev: false - /non-layered-tidy-tree-layout@2.0.2: resolution: {integrity: sha512-gkXMxRzUH+PB0ax9dUN0yYF0S25BqeAYqhgMaLUFmpXLEk7Fcu8f4emJuOAY0V8kjDICxROIKsTAKsV/v355xw==} dev: false @@ -3760,27 +3559,6 @@ packages: source-map-js: 1.0.2 dev: false - /precinct@11.0.5: - resolution: {integrity: sha512-oHSWLC8cL/0znFhvln26D14KfCQFFn4KOLSw6hmLhd+LQ2SKt9Ljm89but76Pc7flM9Ty1TnXyrA2u16MfRV3w==} - engines: {node: ^14.14.0 || >=16.0.0} - hasBin: true - dependencies: - '@dependents/detective-less': 4.1.0 - commander: 10.0.1 - detective-amd: 5.0.2 - detective-cjs: 5.0.1 - detective-es6: 4.0.1 - detective-postcss: 6.1.3 - detective-sass: 5.0.3 - detective-scss: 4.0.3 - detective-stylus: 4.0.0 - detective-typescript: 11.1.0 - module-definition: 5.0.1 - node-source-walk: 6.0.2 - transitivePeerDependencies: - - supports-color - dev: false - /prettier@3.0.3: resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} engines: {node: '>=14'} @@ -3808,10 +3586,6 @@ packages: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: false - /quote-unquote@1.0.0: - resolution: {integrity: sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==} - dev: false - /react-dom@18.2.0(react@18.2.0): resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} peerDependencies: @@ -3855,6 +3629,10 @@ packages: resolution: {integrity: sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg==} dev: false + /reflect-metadata@0.2.1: + resolution: {integrity: sha512-i5lLI6iw9AU3Uu4szRNPPEkomnkjRTaVt9hy/bn5g/oSzekBSMeLZblcjP74AW0vBabqERLLIrz+gR8QYR54Tw==} + dev: false + /regenerator-runtime@0.14.0: resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==} dev: false @@ -4129,6 +3907,7 @@ packages: /source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + dev: true /source-map@0.7.4: resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} @@ -4342,11 +4121,6 @@ packages: engines: {node: '>=0.10.0'} dev: false - /to-fast-properties@2.0.0: - resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} - engines: {node: '>=4'} - dev: false - /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -4386,14 +4160,10 @@ packages: resolution: {integrity: sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ==} dev: true - /tslib@1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - dev: false - /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - /tsup@7.2.0(postcss@8.4.31)(typescript@5.2.2): + /tsup@7.2.0(typescript@5.2.2): resolution: {integrity: sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ==} engines: {node: '>=16.14'} hasBin: true @@ -4429,16 +4199,6 @@ packages: - ts-node dev: false - /tsutils@3.21.0(typescript@5.2.2): - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - 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' - dependencies: - tslib: 1.14.1 - typescript: 5.2.2 - dev: false - /tsx@3.12.10: resolution: {integrity: sha512-2+46h4xvUt1aLDNvk5YBT8Uzw+b7BolGbn7iSMucYqCXZiDc+1IMghLVdw8kKjING32JFOeO+Am9posvjkeclA==} hasBin: true