diff --git a/.github/workflows/wf_check-changes.yml b/.github/workflows/wf_check-changes.yml index 7df309c40..a15c90c57 100644 --- a/.github/workflows/wf_check-changes.yml +++ b/.github/workflows/wf_check-changes.yml @@ -3,7 +3,7 @@ on: push: branches: - main - - 'v2.x.x' + - v2.x.x paths-ignore: - '**.md' - 'website/**' @@ -14,6 +14,7 @@ on: pull_request: branches: - main + - v2.x.x paths-ignore: - '**.md' - 'website/**' diff --git a/.github/workflows/wf_check-lint.yml b/.github/workflows/wf_check-lint.yml index 1504e4d77..4005cdcfa 100644 --- a/.github/workflows/wf_check-lint.yml +++ b/.github/workflows/wf_check-lint.yml @@ -3,7 +3,7 @@ on: pull_request: branches: - main - - 'v2.x.x' + - v2.x.x paths-ignore: - '**.md' - 'website/**' diff --git a/.github/workflows/wf_test-unit.yml b/.github/workflows/wf_test-unit.yml index 3fded5d6f..fe94e72ec 100644 --- a/.github/workflows/wf_test-unit.yml +++ b/.github/workflows/wf_test-unit.yml @@ -3,7 +3,7 @@ on: push: branches: - main - - 'v2.x.x' + - v2.x.x paths-ignore: - '**.md' - 'website/**' @@ -14,6 +14,7 @@ on: pull_request: branches: - main + - v2.x.x paths-ignore: - '**.md' - 'website/**' diff --git a/common/changes/@boostercloud/framework-core/upgrade-ts-patch_2023-09-24-17-59.json b/common/changes/@boostercloud/framework-core/upgrade-ts-patch_2023-09-24-17-59.json new file mode 100644 index 000000000..e90d1088c --- /dev/null +++ b/common/changes/@boostercloud/framework-core/upgrade-ts-patch_2023-09-24-17-59.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@boostercloud/framework-core", + "comment": "Replaced the deprecated dependency `ttypescript` with `ts-patch`", + "type": "minor" + } + ], + "packageName": "@boostercloud/framework-core" +} \ No newline at end of file diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 5c9776acb..0b3a2629f 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -419,8 +419,8 @@ importers: sinon: 9.2.3 subscriptions-transport-ws: 0.11.0 ts-node: ^10.9.1 + ts-patch: 2.0.2 tslib: ^2.4.0 - ttypescript: 1.5.15 typescript: 4.7.4 dependencies: '@boostercloud/framework-common-helpers': link:../framework-common-helpers @@ -487,7 +487,7 @@ importers: sinon: 9.2.3 subscriptions-transport-ws: 0.11.0_graphql@16.6.0 ts-node: 10.9.1_xpss65pzqvfdcnzjlkstkx6toy - ttypescript: 1.5.15_6oasmw356qmm23djlsjgkwvrtm + ts-patch: 2.0.2_typescript@4.7.4 typescript: 4.7.4 ../../packages/framework-provider-aws: @@ -1137,8 +1137,8 @@ importers: sinon: 9.2.3 ts-morph: 15.1.0 ts-node: ^10.9.1 + ts-patch: 2.0.2 tslib: ^2.4.0 - ttypescript: 1.5.15 typescript: 4.7.4 dependencies: '@effect-ts/core': 0.60.5 @@ -1159,7 +1159,7 @@ importers: rimraf: 5.0.0 sinon: 9.2.3 ts-node: 10.9.1_xpss65pzqvfdcnzjlkstkx6toy - ttypescript: 1.5.15_6oasmw356qmm23djlsjgkwvrtm + ts-patch: 2.0.2_typescript@4.7.4 typescript: 4.7.4 ../../tools/eslint-config: @@ -1311,9 +1311,9 @@ packages: dependencies: '@aws-cdk/aws-certificatemanager': 1.199.0_aklsbzsp6i2n6pzp4sxy6hufne '@aws-cdk/aws-cloudwatch': 1.199.0_wcptolxmxi6sy3vjqhvgbrrnvi - '@aws-cdk/aws-cognito': 1.199.0_4ejvrq2frkzailkr27vdockoii + '@aws-cdk/aws-cognito': 1.199.0_hzslyw5ts33yz4we44vxrnbbrm '@aws-cdk/aws-ec2': 1.199.0_ylylsu27pdmlfxyxktlluxtkr4 - '@aws-cdk/aws-elasticloadbalancingv2': 1.199.0_hteww72hqzoereozif3gblcodi + '@aws-cdk/aws-elasticloadbalancingv2': 1.199.0_74oizvoelbxgex3gbujl2xzm54 '@aws-cdk/aws-iam': 1.199.0_xwfh4icwyvj4zfjhzlqde6qllu '@aws-cdk/aws-lambda': 1.199.0_5pbncl2no5vqinyo3n2ekkob5q '@aws-cdk/aws-logs': 1.199.0_tqi77pcvvujtgay5663ykqn7wy @@ -1395,7 +1395,7 @@ packages: '@aws-cdk/core': 1.199.0 constructs: ^3.3.69 dependencies: - '@aws-cdk/aws-autoscaling': 1.199.0_6aw2ag5odq3zb2mttwz3fxe3hu + '@aws-cdk/aws-autoscaling': 1.199.0_6ioy6wqnsnl357btnhiggvri2y '@aws-cdk/aws-iam': 1.199.0_xwfh4icwyvj4zfjhzlqde6qllu '@aws-cdk/aws-kms': 1.199.0_iumdymv27iwprkm3rzoqxlpuia '@aws-cdk/aws-lambda': 1.199.0_5pbncl2no5vqinyo3n2ekkob5q @@ -1406,7 +1406,7 @@ packages: constructs: 3.4.293 dev: false - /@aws-cdk/aws-autoscaling/1.199.0_6aw2ag5odq3zb2mttwz3fxe3hu: + /@aws-cdk/aws-autoscaling/1.199.0_6ioy6wqnsnl357btnhiggvri2y: resolution: {integrity: sha512-JSwF4UC3JB1KpIQtLUhQytrhSBeEBxe20tLZy6lsdsULtJRz/rbz1Fm4GGUiqefX3gd9qcQBL5pwNlHhjGjZbg==} engines: {node: '>= 14.15.0'} peerDependencies: @@ -1418,7 +1418,7 @@ packages: '@aws-cdk/aws-cloudwatch': 1.199.0_wcptolxmxi6sy3vjqhvgbrrnvi '@aws-cdk/aws-ec2': 1.199.0_ylylsu27pdmlfxyxktlluxtkr4 '@aws-cdk/aws-elasticloadbalancing': 1.199.0_ehdkigggl2baqdi4l6p7upw4f4 - '@aws-cdk/aws-elasticloadbalancingv2': 1.199.0_hteww72hqzoereozif3gblcodi + '@aws-cdk/aws-elasticloadbalancingv2': 1.199.0_74oizvoelbxgex3gbujl2xzm54 '@aws-cdk/aws-iam': 1.199.0_xwfh4icwyvj4zfjhzlqde6qllu '@aws-cdk/aws-sns': 1.199.0_wim6pvar6pmwiq3fs3ksmix5ru '@aws-cdk/core': 1.199.0_kscyon7amn7dglog7cugnqvkwm @@ -1429,6 +1429,7 @@ packages: - '@aws-cdk/aws-lambda' - '@aws-cdk/aws-logs' - '@aws-cdk/aws-s3' + - '@aws-cdk/custom-resources' - '@aws-cdk/cx-api' dev: false @@ -1620,7 +1621,7 @@ packages: constructs: 3.4.293 dev: false - /@aws-cdk/aws-cognito/1.199.0_4ejvrq2frkzailkr27vdockoii: + /@aws-cdk/aws-cognito/1.199.0_hzslyw5ts33yz4we44vxrnbbrm: resolution: {integrity: sha512-keHKhvJmAGcIbaAK/liyeI6HYaK9Dm4IhP+gXfHjMpr2Cm0Rd5WhNJtNsekVoa9m3w0agDFW8qOMDo6O2gVTzA==} engines: {node: '>= 14.15.0'} peerDependencies: @@ -1630,12 +1631,18 @@ packages: '@aws-cdk/custom-resources': 1.199.0 constructs: ^3.3.69 dependencies: + '@aws-cdk/aws-certificatemanager': 1.199.0_aklsbzsp6i2n6pzp4sxy6hufne '@aws-cdk/aws-iam': 1.199.0_xwfh4icwyvj4zfjhzlqde6qllu + '@aws-cdk/aws-kms': 1.199.0_iumdymv27iwprkm3rzoqxlpuia '@aws-cdk/aws-lambda': 1.199.0_5pbncl2no5vqinyo3n2ekkob5q '@aws-cdk/core': 1.199.0_kscyon7amn7dglog7cugnqvkwm '@aws-cdk/custom-resources': 1.199.0_6aw2ag5odq3zb2mttwz3fxe3hu constructs: 3.4.293 punycode: 2.3.0 + transitivePeerDependencies: + - '@aws-cdk/aws-ec2' + - '@aws-cdk/aws-logs' + - '@aws-cdk/cx-api' dev: false bundledDependencies: - punycode @@ -1653,7 +1660,7 @@ packages: '@aws-cdk/aws-applicationautoscaling': 1.199.0_wcptolxmxi6sy3vjqhvgbrrnvi '@aws-cdk/aws-cloudwatch': 1.199.0_wcptolxmxi6sy3vjqhvgbrrnvi '@aws-cdk/aws-iam': 1.199.0_xwfh4icwyvj4zfjhzlqde6qllu - '@aws-cdk/aws-kinesis': 1.199.0_e2y6n4vxxh6w5ycsjwgdk7fg7q + '@aws-cdk/aws-kinesis': 1.199.0_yvevwnsp6zaocssyslvdojryte '@aws-cdk/aws-kms': 1.199.0_iumdymv27iwprkm3rzoqxlpuia '@aws-cdk/aws-lambda': 1.199.0_5pbncl2no5vqinyo3n2ekkob5q '@aws-cdk/core': 1.199.0_kscyon7amn7dglog7cugnqvkwm @@ -1741,7 +1748,7 @@ packages: constructs: ^3.3.69 dependencies: '@aws-cdk/aws-applicationautoscaling': 1.199.0_wcptolxmxi6sy3vjqhvgbrrnvi - '@aws-cdk/aws-autoscaling': 1.199.0_6aw2ag5odq3zb2mttwz3fxe3hu + '@aws-cdk/aws-autoscaling': 1.199.0_6ioy6wqnsnl357btnhiggvri2y '@aws-cdk/aws-autoscaling-hooktargets': 1.199.0_wiaz33wtwefkv5d3nn7hbhuhmu '@aws-cdk/aws-certificatemanager': 1.199.0_aklsbzsp6i2n6pzp4sxy6hufne '@aws-cdk/aws-cloudwatch': 1.199.0_wcptolxmxi6sy3vjqhvgbrrnvi @@ -1749,17 +1756,17 @@ packages: '@aws-cdk/aws-ecr': 1.199.0_5lpmbvgigeswzbugyujlevszcq '@aws-cdk/aws-ecr-assets': 1.199.0_u6wgonek7tj4xuwvr3d2ei6crq '@aws-cdk/aws-elasticloadbalancing': 1.199.0_ehdkigggl2baqdi4l6p7upw4f4 - '@aws-cdk/aws-elasticloadbalancingv2': 1.199.0_hteww72hqzoereozif3gblcodi + '@aws-cdk/aws-elasticloadbalancingv2': 1.199.0_74oizvoelbxgex3gbujl2xzm54 '@aws-cdk/aws-iam': 1.199.0_xwfh4icwyvj4zfjhzlqde6qllu '@aws-cdk/aws-kms': 1.199.0_iumdymv27iwprkm3rzoqxlpuia '@aws-cdk/aws-lambda': 1.199.0_5pbncl2no5vqinyo3n2ekkob5q '@aws-cdk/aws-logs': 1.199.0_tqi77pcvvujtgay5663ykqn7wy '@aws-cdk/aws-route53': 1.199.0_ytf4bxsrhewrt5j5jnuzynemxy - '@aws-cdk/aws-route53-targets': 1.199.0_2ap25t3f2ak5h2qxfnvuyuxrga + '@aws-cdk/aws-route53-targets': 1.199.0_6qn3q4quwxpkjgl3z2r2rmaqqi '@aws-cdk/aws-s3': 1.199.0_wim6pvar6pmwiq3fs3ksmix5ru '@aws-cdk/aws-s3-assets': 1.199.0_tqi77pcvvujtgay5663ykqn7wy '@aws-cdk/aws-secretsmanager': 1.199.0_maqnqwhn36fygp3z4rdnivbxii - '@aws-cdk/aws-servicediscovery': 1.199.0_mcuiip26demcvhycudknexqcta + '@aws-cdk/aws-servicediscovery': 1.199.0_4axszbdsnc7kzhsa3r5g56z4bu '@aws-cdk/aws-sns': 1.199.0_wim6pvar6pmwiq3fs3ksmix5ru '@aws-cdk/aws-sqs': 1.199.0_iumdymv27iwprkm3rzoqxlpuia '@aws-cdk/aws-ssm': 1.199.0_iumdymv27iwprkm3rzoqxlpuia @@ -1810,7 +1817,7 @@ packages: constructs: 3.4.293 dev: false - /@aws-cdk/aws-elasticloadbalancingv2/1.199.0_hteww72hqzoereozif3gblcodi: + /@aws-cdk/aws-elasticloadbalancingv2/1.199.0_74oizvoelbxgex3gbujl2xzm54: resolution: {integrity: sha512-cb8dYlmqEjYRORTAu9Y8Xaiw3cZ0RSmCqiFL8Mj+IgxANDg9QdaMxdQu8QPWnC7+uVFWkbnD6G6NRL7FAPgnIA==} engines: {node: '>= 14.15.0'} peerDependencies: @@ -1821,14 +1828,22 @@ packages: '@aws-cdk/cx-api': 1.199.0 constructs: ^3.3.69 dependencies: + '@aws-cdk/aws-certificatemanager': 1.199.0_aklsbzsp6i2n6pzp4sxy6hufne + '@aws-cdk/aws-cloudwatch': 1.199.0_wcptolxmxi6sy3vjqhvgbrrnvi + '@aws-cdk/aws-ec2': 1.199.0_ylylsu27pdmlfxyxktlluxtkr4 '@aws-cdk/aws-iam': 1.199.0_xwfh4icwyvj4zfjhzlqde6qllu '@aws-cdk/aws-lambda': 1.199.0_5pbncl2no5vqinyo3n2ekkob5q + '@aws-cdk/aws-route53': 1.199.0_ytf4bxsrhewrt5j5jnuzynemxy '@aws-cdk/aws-s3': 1.199.0_wim6pvar6pmwiq3fs3ksmix5ru '@aws-cdk/cloud-assembly-schema': 1.199.0 '@aws-cdk/core': 1.199.0_kscyon7amn7dglog7cugnqvkwm '@aws-cdk/cx-api': 1.199.0 '@aws-cdk/region-info': 1.199.0 constructs: 3.4.293 + transitivePeerDependencies: + - '@aws-cdk/assets' + - '@aws-cdk/aws-logs' + - '@aws-cdk/custom-resources' dev: false /@aws-cdk/aws-events-targets/1.199.0_efa47vukfsbcitdg2oy6em6xpe: @@ -1845,14 +1860,14 @@ packages: constructs: ^3.3.69 dependencies: '@aws-cdk/aws-apigateway': 1.199.0_6ioy6wqnsnl357btnhiggvri2y - '@aws-cdk/aws-autoscaling': 1.199.0_6aw2ag5odq3zb2mttwz3fxe3hu + '@aws-cdk/aws-autoscaling': 1.199.0_6ioy6wqnsnl357btnhiggvri2y '@aws-cdk/aws-codebuild': 1.199.0_6aw2ag5odq3zb2mttwz3fxe3hu '@aws-cdk/aws-codepipeline': 1.199.0_z4s7qll3yvb46zglrdwf6455hq '@aws-cdk/aws-ec2': 1.199.0_ylylsu27pdmlfxyxktlluxtkr4 '@aws-cdk/aws-ecs': 1.199.0_7m5azgjywxpgdeoosvoxrcdts4 '@aws-cdk/aws-events': 1.199.0_wcptolxmxi6sy3vjqhvgbrrnvi '@aws-cdk/aws-iam': 1.199.0_xwfh4icwyvj4zfjhzlqde6qllu - '@aws-cdk/aws-kinesis': 1.199.0_e2y6n4vxxh6w5ycsjwgdk7fg7q + '@aws-cdk/aws-kinesis': 1.199.0_yvevwnsp6zaocssyslvdojryte '@aws-cdk/aws-kinesisfirehose': 1.199.0_maqnqwhn36fygp3z4rdnivbxii '@aws-cdk/aws-kms': 1.199.0_iumdymv27iwprkm3rzoqxlpuia '@aws-cdk/aws-lambda': 1.199.0_5pbncl2no5vqinyo3n2ekkob5q @@ -1912,7 +1927,7 @@ packages: constructs: 3.4.293 dev: false - /@aws-cdk/aws-kinesis/1.199.0_e2y6n4vxxh6w5ycsjwgdk7fg7q: + /@aws-cdk/aws-kinesis/1.199.0_yvevwnsp6zaocssyslvdojryte: resolution: {integrity: sha512-ASDtGXG1ZvBWpDUj9oT12tF5+jG+R7bykcflfE+KTTXX3mJy1S5gn3YQbb6hV5V+TYPyVckSeW2z0pHSL3RkpQ==} engines: {node: '>= 14.15.0'} peerDependencies: @@ -1923,12 +1938,9 @@ packages: dependencies: '@aws-cdk/aws-cloudwatch': 1.199.0_wcptolxmxi6sy3vjqhvgbrrnvi '@aws-cdk/aws-iam': 1.199.0_xwfh4icwyvj4zfjhzlqde6qllu - '@aws-cdk/aws-kms': 1.199.0_iumdymv27iwprkm3rzoqxlpuia '@aws-cdk/aws-logs': 1.199.0_tqi77pcvvujtgay5663ykqn7wy '@aws-cdk/core': 1.199.0_kscyon7amn7dglog7cugnqvkwm constructs: 3.4.293 - transitivePeerDependencies: - - '@aws-cdk/cx-api' dev: false /@aws-cdk/aws-kinesisfirehose/1.199.0_maqnqwhn36fygp3z4rdnivbxii: @@ -1945,7 +1957,7 @@ packages: '@aws-cdk/aws-cloudwatch': 1.199.0_wcptolxmxi6sy3vjqhvgbrrnvi '@aws-cdk/aws-ec2': 1.199.0_ylylsu27pdmlfxyxktlluxtkr4 '@aws-cdk/aws-iam': 1.199.0_xwfh4icwyvj4zfjhzlqde6qllu - '@aws-cdk/aws-kinesis': 1.199.0_e2y6n4vxxh6w5ycsjwgdk7fg7q + '@aws-cdk/aws-kinesis': 1.199.0_yvevwnsp6zaocssyslvdojryte '@aws-cdk/aws-kms': 1.199.0_iumdymv27iwprkm3rzoqxlpuia '@aws-cdk/aws-lambda': 1.199.0_5pbncl2no5vqinyo3n2ekkob5q '@aws-cdk/aws-logs': 1.199.0_tqi77pcvvujtgay5663ykqn7wy @@ -1992,7 +2004,7 @@ packages: '@aws-cdk/aws-ec2': 1.199.0_ylylsu27pdmlfxyxktlluxtkr4 '@aws-cdk/aws-events': 1.199.0_wcptolxmxi6sy3vjqhvgbrrnvi '@aws-cdk/aws-iam': 1.199.0_xwfh4icwyvj4zfjhzlqde6qllu - '@aws-cdk/aws-kinesis': 1.199.0_e2y6n4vxxh6w5ycsjwgdk7fg7q + '@aws-cdk/aws-kinesis': 1.199.0_yvevwnsp6zaocssyslvdojryte '@aws-cdk/aws-lambda': 1.199.0_5pbncl2no5vqinyo3n2ekkob5q '@aws-cdk/aws-s3': 1.199.0_wim6pvar6pmwiq3fs3ksmix5ru '@aws-cdk/aws-s3-notifications': 1.199.0_fufarp47blk4okwshjegj2wjg4 @@ -2065,7 +2077,7 @@ packages: - '@aws-cdk/aws-s3' dev: false - /@aws-cdk/aws-route53-targets/1.199.0_2ap25t3f2ak5h2qxfnvuyuxrga: + /@aws-cdk/aws-route53-targets/1.199.0_6qn3q4quwxpkjgl3z2r2rmaqqi: resolution: {integrity: sha512-l8cg4zZncQ2JUF4Hd8kvouWYi5y63/2PKU57MY64dUC7wL/VjeEQMRJhehB11rt1OAbp/SNB2f/dnSTcNA8dmA==} engines: {node: '>= 14.15.0'} peerDependencies: @@ -2079,10 +2091,10 @@ packages: dependencies: '@aws-cdk/aws-apigateway': 1.199.0_6ioy6wqnsnl357btnhiggvri2y '@aws-cdk/aws-cloudfront': 1.199.0_74oizvoelbxgex3gbujl2xzm54 - '@aws-cdk/aws-cognito': 1.199.0_4ejvrq2frkzailkr27vdockoii + '@aws-cdk/aws-cognito': 1.199.0_hzslyw5ts33yz4we44vxrnbbrm '@aws-cdk/aws-ec2': 1.199.0_ylylsu27pdmlfxyxktlluxtkr4 '@aws-cdk/aws-elasticloadbalancing': 1.199.0_ehdkigggl2baqdi4l6p7upw4f4 - '@aws-cdk/aws-elasticloadbalancingv2': 1.199.0_hteww72hqzoereozif3gblcodi + '@aws-cdk/aws-elasticloadbalancingv2': 1.199.0_74oizvoelbxgex3gbujl2xzm54 '@aws-cdk/aws-globalaccelerator': 1.199.0_uhmkgheirzwotmxej4ph7fbqla '@aws-cdk/aws-iam': 1.199.0_xwfh4icwyvj4zfjhzlqde6qllu '@aws-cdk/aws-route53': 1.199.0_ytf4bxsrhewrt5j5jnuzynemxy @@ -2091,6 +2103,7 @@ packages: '@aws-cdk/region-info': 1.199.0 constructs: 3.4.293 transitivePeerDependencies: + - '@aws-cdk/assets' - '@aws-cdk/aws-lambda' - '@aws-cdk/aws-logs' - '@aws-cdk/custom-resources' @@ -2244,7 +2257,7 @@ packages: - '@aws-cdk/aws-s3' dev: false - /@aws-cdk/aws-servicediscovery/1.199.0_mcuiip26demcvhycudknexqcta: + /@aws-cdk/aws-servicediscovery/1.199.0_4axszbdsnc7kzhsa3r5g56z4bu: resolution: {integrity: sha512-OSGcZQE5N4ynBFcv54XWSbfunBym5r/hHstpONZkRB+jf9nFEqaVqno9ZgeLU3in5m/QuK781g+dx0r0M0Ao6w==} engines: {node: '>= 14.15.0'} peerDependencies: @@ -2253,11 +2266,12 @@ packages: constructs: ^3.3.69 dependencies: '@aws-cdk/aws-ec2': 1.199.0_ylylsu27pdmlfxyxktlluxtkr4 - '@aws-cdk/aws-elasticloadbalancingv2': 1.199.0_hteww72hqzoereozif3gblcodi + '@aws-cdk/aws-elasticloadbalancingv2': 1.199.0_74oizvoelbxgex3gbujl2xzm54 '@aws-cdk/aws-route53': 1.199.0_ytf4bxsrhewrt5j5jnuzynemxy '@aws-cdk/core': 1.199.0_kscyon7amn7dglog7cugnqvkwm constructs: 3.4.293 transitivePeerDependencies: + - '@aws-cdk/assets' - '@aws-cdk/aws-iam' - '@aws-cdk/aws-lambda' - '@aws-cdk/aws-logs' @@ -6615,6 +6629,26 @@ packages: once: 1.4.0 path-is-absolute: 1.0.1 + /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: true + + /global-prefix/3.0.0: + resolution: {integrity: sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==} + engines: {node: '>=6'} + dependencies: + ini: 1.3.8 + kind-of: 6.0.3 + which: 1.3.1 + dev: true + /globals/11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -6942,6 +6976,10 @@ packages: /inherits/2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + /ini/1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + dev: true + /ink-select-input/4.2.2_ink@3.2.0+react@17.0.2: resolution: {integrity: sha512-E5AS2Vnd4CSzEa7Rm+hG47wxRQo1ASfh4msKxO7FHmn/ym+GKSSsFIfR+FonqjKNDPXYJClw8lM47RdN3Pi+nw==} engines: {node: '>=10'} @@ -7040,6 +7078,11 @@ packages: has: 1.0.3 side-channel: 1.0.4 + /interpret/1.4.0: + resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} + engines: {node: '>= 0.10'} + dev: true + /ipaddr.js/1.9.1: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} @@ -7665,6 +7708,11 @@ packages: json-buffer: 3.0.1 dev: true + /kind-of/6.0.3: + resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} + engines: {node: '>=0.10.0'} + dev: true + /lazystream/1.0.1: resolution: {integrity: sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==} engines: {node: '>= 0.6.3'} @@ -9102,6 +9150,13 @@ packages: picomatch: 2.3.1 dev: true + /rechoir/0.6.2: + resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} + engines: {node: '>= 0.10'} + dependencies: + resolve: 1.22.2 + dev: true + /redeyed/2.1.1: resolution: {integrity: sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ==} dependencies: @@ -9482,6 +9537,16 @@ packages: /shell-quote/1.8.1: resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} + /shelljs/0.8.5: + resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==} + engines: {node: '>=4'} + hasBin: true + dependencies: + glob: 7.2.3 + interpret: 1.4.0 + rechoir: 0.6.2 + dev: true + /shortid/2.2.16: resolution: {integrity: sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g==} dependencies: @@ -10119,6 +10184,22 @@ packages: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + /ts-patch/2.0.2_typescript@4.7.4: + resolution: {integrity: sha512-NbgdS/J/ylaARJVaF1w4cPw378yvw6C1026fU5NKC2GO4jCwRlkuE/G7gwknNMHwkAOhwamKjuzkuLw/u4KlBg==} + hasBin: true + peerDependencies: + typescript: '>=4.0.0' + dependencies: + chalk: 4.1.2 + glob: 8.1.0 + global-prefix: 3.0.0 + minimist: 1.2.8 + resolve: 1.22.2 + shelljs: 0.8.5 + strip-ansi: 6.0.1 + typescript: 4.7.4 + dev: true + /tsconfig-paths/3.14.2: resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==} dependencies: @@ -10142,18 +10223,6 @@ packages: tslib: 1.14.1 typescript: 4.7.4 - /ttypescript/1.5.15_6oasmw356qmm23djlsjgkwvrtm: - resolution: {integrity: sha512-48ykDNHzFnPMnv4hYX1P8Q84TvCZyL1QlFxeuxsuZ48X2+ameBgPenvmCkHJtoOSxpoWTWi8NcgNrRnVDOmfSg==} - hasBin: true - peerDependencies: - ts-node: '>=8.0.2' - typescript: '>=3.2.2' - dependencies: - resolve: 1.22.2 - ts-node: 10.9.1_xpss65pzqvfdcnzjlkstkx6toy - typescript: 4.7.4 - dev: true - /tunnel-agent/0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} dependencies: diff --git a/packages/application-tester/package.json b/packages/application-tester/package.json index d4c07d7e3..85ad84537 100644 --- a/packages/application-tester/package.json +++ b/packages/application-tester/package.json @@ -24,7 +24,7 @@ "lint:check": "eslint --ext '.js,.ts' **/*.ts", "lint:fix": "eslint --quiet --fix --ext '.js,.ts' **/*.ts", "build": "tsc -b tsconfig.json", - "clean": "npx rimraf ./dist tsconfig.tsbuildinfo", + "clean": "rimraf ./dist tsconfig.tsbuildinfo", "prepack": "tsc -b tsconfig.json", "test": "" }, diff --git a/packages/cli/src/templates/project/package-json.ts b/packages/cli/src/templates/project/package-json.ts index 46c0050b1..35fb765f1 100644 --- a/packages/cli/src/templates/project/package-json.ts +++ b/packages/cli/src/templates/project/package-json.ts @@ -31,8 +31,8 @@ export const template = `{ "prettier": "2.3.0", "typescript": "4.7.4", "ts-node": "9.1.1", - "ttypescript": "1.5.15", "@types/node": "^18.15.3", + "ts-patch": "2.0.2", "graphql": "^16.6.0" }, "engines": { @@ -43,9 +43,10 @@ export const template = `{ "main": "dist/index.js", "repository": "{{{repository}}}", "scripts": { + "prepare": "ts-patch install -s", "lint:check": "eslint --ext '.js,.ts' **/*.ts", "lint:fix": "eslint --quiet --fix --ext '.js,.ts' **/*.ts", - "build": "ttsc -b tsconfig.json", + "build": "tsc -b tsconfig.json", "clean": "rimraf ./dist tsconfig.tsbuildinfo" }, "types": "lib/index.d.ts" diff --git a/packages/framework-core/tsconfig.json b/packages/framework-core/tsconfig.json index c276cbf26..36864ce0f 100644 --- a/packages/framework-core/tsconfig.json +++ b/packages/framework-core/tsconfig.json @@ -6,7 +6,6 @@ }, "include": ["src/**/*"], "ts-node": { - "compiler": "ttypescript", "compilerOptions": { "plugins": [ { diff --git a/packages/framework-integration-tests/integration/fixtures/cart-demo/package.json b/packages/framework-integration-tests/integration/fixtures/cart-demo/package.json index 7398a24ed..aafb8a4c4 100644 --- a/packages/framework-integration-tests/integration/fixtures/cart-demo/package.json +++ b/packages/framework-integration-tests/integration/fixtures/cart-demo/package.json @@ -23,7 +23,7 @@ "ts-node": "whatever", "@types/node": "whatever", "@boostercloud/framework-provider-aws-infrastructure": "whatever", - "ttypescript": "whatever", + "ts-patch": "whatever", "@boostercloud/metadata-booster": "whatever", "graphql": "^16.6.0" }, @@ -35,9 +35,10 @@ "main": "dist/index.js", "repository": "repository_placeholder", "scripts": { + "prepare": "ts-patch install -s", "lint:check": "eslint --ext '.js,.ts' **/*.ts", "lint:fix": "eslint --quiet --fix --ext '.js,.ts' **/*.ts", - "build": "ttsc -b tsconfig.json", + "build": "tsc -b tsconfig.json", "clean": "rimraf ./dist tsconfig.tsbuildinfo" }, "types": "lib/index.d.ts" diff --git a/packages/framework-integration-tests/integration/provider-unaware/cli/cli.project.integration.ts b/packages/framework-integration-tests/integration/provider-unaware/cli/cli.project.integration.ts index d6075954f..8d1562658 100644 --- a/packages/framework-integration-tests/integration/provider-unaware/cli/cli.project.integration.ts +++ b/packages/framework-integration-tests/integration/provider-unaware/cli/cli.project.integration.ts @@ -15,7 +15,6 @@ import { expect } from '../../helper/expect' // The Booster CLI version used should match the integration tests' version const BOOSTER_VERSION = require('../../../package.json').version - const TEST_TIMEOUT = 80000 const DESCRIPTION = 'cart-demo' const VERSION = '1.0.0' diff --git a/packages/framework-integration-tests/integration/provider-unaware/cli/setup.ts b/packages/framework-integration-tests/integration/provider-unaware/cli/setup.ts index 9dc06f930..1a6c80ced 100644 --- a/packages/framework-integration-tests/integration/provider-unaware/cli/setup.ts +++ b/packages/framework-integration-tests/integration/provider-unaware/cli/setup.ts @@ -1,3 +1,5 @@ +import { setEnv } from '../../helper/app-helper' + before(async () => { - // Nothing so far + await setEnv() }) diff --git a/packages/framework-integration-tests/package.json b/packages/framework-integration-tests/package.json index 668085f3f..f7e4b4045 100644 --- a/packages/framework-integration-tests/package.json +++ b/packages/framework-integration-tests/package.json @@ -72,7 +72,7 @@ "serverless-artillery": "0.5.2", "subscriptions-transport-ws": "0.11.0", "ts-node": "^10.9.1", - "ttypescript": "1.5.15", + "ts-patch": "2.0.2", "typescript": "4.7.4", "sinon": "9.2.3", "eslint-plugin-unicorn": "~44.0.2" @@ -84,32 +84,33 @@ "main": "dist/index.js", "repository": "boostercloud/booster", "scripts": { + "prepare": "ts-patch install -s", "test": "", "watch:local": "nodemon --watch ../framework-provider-local/dist --watch ../framework-provider-local-infrastructure --watch dist --exec \"./node_modules/.bin/boost start -e local\"", "lint:check": "eslint --ext '.js,.ts' **/*.ts", "lint:fix": "eslint --quiet --fix --ext '.js,.ts' **/*.ts", - "build": "ttsc -b tsconfig.json", + "build": "tsc -b tsconfig.json", "clean": "rimraf ./dist tsconfig.tsbuildinfo *-integration-sandbox", "postinstall": "rimraf ../../node_modules/serverless/node_modules/archiver && echo 'Deleted buggy \"archiver\" module from \"serveless\" dependencies to use the newer hoisted one'", - "integration": "npm run integration/cli && npm run integration/local && npm run integration/aws && npm run integration/azure", - "integration/cli": "mocha --exit --config \"integration/provider-unaware/cli/.mocharc.yml\" \"integration/provider-unaware/cli/**/*.integration.ts\"", - "integration/aws": "npm run integration/aws-deploy && npm run integration/aws-func && npm run integration/aws-end-to-end && npm run integration/aws-load && npm run integration/aws-nuke", - "integration/aws-deploy": "AWS_SDK_LOAD_CONFIG=true BOOSTER_ENV=production mocha --forbid-only --exit --config \"integration/provider-specific/aws/deployment/.mocharc.yml\" \"integration/provider-specific/aws/deployment/**/*.integration.ts\"", - "integration/aws-func": "TESTED_PROVIDER=AWS AWS_SDK_LOAD_CONFIG=true BOOSTER_ENV=production mocha --forbid-only --exit --config \"integration/provider-unaware/functionality/.mocharc.yml\" \"integration/provider-unaware/functionality/**/*.integration.ts\"", - "integration/aws-end-to-end": "TESTED_PROVIDER=AWS AWS_SDK_LOAD_CONFIG=true BOOSTER_ENV=production mocha --forbid-only --exit --config \"integration/provider-unaware/end-to-end/.mocharc.yml\" \"integration/provider-unaware/end-to-end/**/*.integration.ts\"", - "integration/aws-load": "echo 'Skipping integration tests.' # TESTED_PROVIDER=AWS AWS_SDK_LOAD_CONFIG=true BOOSTER_ENV=production mocha --forbid-only --exit --config \"integration/provider-unaware/load/.mocharc.yml\" \"integration/provider-unaware/load/**/*.load.ts\"", - "integration/aws-nuke": "AWS_SDK_LOAD_CONFIG=true BOOSTER_ENV=production mocha --forbid-only --exit --config \"integration/provider-specific/aws/nuke/.mocharc.yml\" \"integration/provider-specific/aws/nuke/**/*.integration.ts\"", - "integration/local": "BOOSTER_ENV=local mocha --forbid-only --exit --config \"integration/provider-specific/local/.mocharc.yml\" \"integration/provider-specific/local/**/*.integration.ts\"", - "integration/local-ongoing": "npm run integration/local-start && npm run integration/local-stop", - "integration/local-start": "BOOSTER_ENV=local mocha --forbid-only --exit --config \"integration/provider-specific/local/start/.mocharc.yml\" \"integration/provider-specific/local/start/*.integration.ts\"", - "integration/local-func": "TESTED_PROVIDER=LOCAL BOOSTER_ENV=local mocha --forbid-only --exit --config \"integration/provider-unaware/functionality/.mocharc.yml\" \"integration/provider-unaware/functionality/**/*.integration.ts\"", - "integration/local-end-to-end": "TESTED_PROVIDER=LOCAL BOOSTER_ENV=local mocha --forbid-only --exit --config \"integration/provider-unaware/end-to-end/.mocharc.yml\" \"integration/provider-unaware/end-to-end/**/*.integration.ts\"", - "integration/local-stop": "BOOSTER_ENV=local mocha --forbid-only --exit --config \"integration/provider-specific/local/stop/.mocharc.yml\" \"integration/provider-specific/local/stop/*.integration.ts\"", - "integration/azure": "npm run integration/azure-deploy && npm run integration/azure-end-to-end && npm run integration/azure-func && npm run integration/azure-nuke", - "integration/azure-deploy": "TESTED_PROVIDER=AZURE BOOSTER_ENV=azure mocha --forbid-only --exit --config \"integration/provider-specific/azure/deployment/.mocharc.yml\" \"integration/provider-specific/azure/deployment/**/*.integration.ts\"", - "integration/azure-nuke": "TESTED_PROVIDER=AZURE BOOSTER_ENV=azure mocha --forbid-only --exit --config \"integration/provider-specific/azure/nuke/.mocharc.yml\" \"integration/provider-specific/azure/nuke/**/*.integration.ts\"", - "integration/azure-end-to-end": "TESTED_PROVIDER=AZURE BOOSTER_ENV=azure mocha --forbid-only --exit --config \"integration/provider-unaware/end-to-end/.mocharc.yml\" \"integration/provider-unaware/end-to-end/**/*.integration.ts\"", - "integration/azure-func": "TESTED_PROVIDER=AZURE BOOSTER_ENV=azure mocha --forbid-only --exit --config \"integration/provider-unaware/end-to-end/.mocharc.yml\" \"integration/provider-unaware/functionality/**/*.integration.ts\"" + "integration": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" npm run integration/cli && npm run integration/local && npm run integration/aws && npm run integration/azure", + "integration/cli": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" BOOSTER_ENV=test mocha --forbid-only --exit --config \"integration/provider-unaware/cli/.mocharc.yml\" \"integration/provider-unaware/cli/**/*.integration.ts\"", + "integration/aws": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" npm run integration/aws-deploy && npm run integration/aws-func && npm run integration/aws-end-to-end && npm run integration/aws-load && npm run integration/aws-nuke", + "integration/aws-deploy": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" AWS_SDK_LOAD_CONFIG=true BOOSTER_ENV=production mocha --forbid-only --exit --config \"integration/provider-specific/aws/deployment/.mocharc.yml\" \"integration/provider-specific/aws/deployment/**/*.integration.ts\"", + "integration/aws-func": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" TESTED_PROVIDER=AWS AWS_SDK_LOAD_CONFIG=true BOOSTER_ENV=production mocha --forbid-only --exit --config \"integration/provider-unaware/functionality/.mocharc.yml\" \"integration/provider-unaware/functionality/**/*.integration.ts\"", + "integration/aws-end-to-end": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" TESTED_PROVIDER=AWS AWS_SDK_LOAD_CONFIG=true BOOSTER_ENV=production mocha --forbid-only --exit --config \"integration/provider-unaware/end-to-end/.mocharc.yml\" \"integration/provider-unaware/end-to-end/**/*.integration.ts\"", + "integration/aws-load": "echo 'Skipping integration tests.' # TS_NODE_PROJECT=\"./tsconfig.integration.json\" TESTED_PROVIDER=AWS AWS_SDK_LOAD_CONFIG=true BOOSTER_ENV=production mocha --forbid-only --exit --config \"integration/provider-unaware/load/.mocharc.yml\" \"integration/provider-unaware/load/**/*.load.ts\"", + "integration/aws-nuke": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" AWS_SDK_LOAD_CONFIG=true BOOSTER_ENV=production mocha --forbid-only --exit --config \"integration/provider-specific/aws/nuke/.mocharc.yml\" \"integration/provider-specific/aws/nuke/**/*.integration.ts\"", + "integration/local": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" BOOSTER_ENV=local mocha --forbid-only --exit --config \"integration/provider-specific/local/.mocharc.yml\" \"integration/provider-specific/local/**/*.integration.ts\"", + "integration/local-ongoing": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" npm run integration/local-start && npm run integration/local-stop", + "integration/local-start": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" BOOSTER_ENV=local mocha --forbid-only --exit --config \"integration/provider-specific/local/start/.mocharc.yml\" \"integration/provider-specific/local/start/*.integration.ts\"", + "integration/local-func": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" TESTED_PROVIDER=LOCAL BOOSTER_ENV=local mocha --forbid-only --exit --config \"integration/provider-unaware/functionality/.mocharc.yml\" \"integration/provider-unaware/functionality/**/*.integration.ts\"", + "integration/local-end-to-end": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" TESTED_PROVIDER=LOCAL BOOSTER_ENV=local mocha --forbid-only --exit --config \"integration/provider-unaware/end-to-end/.mocharc.yml\" \"integration/provider-unaware/end-to-end/**/*.integration.ts\"", + "integration/local-stop": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" BOOSTER_ENV=local mocha --forbid-only --exit --config \"integration/provider-specific/local/stop/.mocharc.yml\" \"integration/provider-specific/local/stop/*.integration.ts\"", + "integration/azure": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" npm run integration/azure-deploy && npm run integration/azure-end-to-end && npm run integration/azure-func && npm run integration/azure-nuke", + "integration/azure-deploy": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" TESTED_PROVIDER=AZURE BOOSTER_ENV=azure mocha --forbid-only --exit --config \"integration/provider-specific/azure/deployment/.mocharc.yml\" \"integration/provider-specific/azure/deployment/**/*.integration.ts\"", + "integration/azure-nuke": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" TESTED_PROVIDER=AZURE BOOSTER_ENV=azure mocha --forbid-only --exit --config \"integration/provider-specific/azure/nuke/.mocharc.yml\" \"integration/provider-specific/azure/nuke/**/*.integration.ts\"", + "integration/azure-end-to-end": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" TESTED_PROVIDER=AZURE BOOSTER_ENV=azure mocha --forbid-only --exit --config \"integration/provider-unaware/end-to-end/.mocharc.yml\" \"integration/provider-unaware/end-to-end/**/*.integration.ts\"", + "integration/azure-func": "TS_NODE_PROJECT=\"./tsconfig.integration.json\" TESTED_PROVIDER=AZURE BOOSTER_ENV=azure mocha --forbid-only --exit --config \"integration/provider-unaware/end-to-end/.mocharc.yml\" \"integration/provider-unaware/functionality/**/*.integration.ts\"" }, "types": "dist/index.d.ts" } diff --git a/packages/framework-integration-tests/tsconfig.eslint.json b/packages/framework-integration-tests/tsconfig.eslint.json index 57a5fd5d4..04954cfbc 100644 --- a/packages/framework-integration-tests/tsconfig.eslint.json +++ b/packages/framework-integration-tests/tsconfig.eslint.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.json", "include": [ "src/**/*", - "integration/**/*", - "test/**/*" + "integration/**/*" ] } \ No newline at end of file diff --git a/packages/framework-integration-tests/tsconfig.integration.json b/packages/framework-integration-tests/tsconfig.integration.json new file mode 100644 index 000000000..d6febc5c0 --- /dev/null +++ b/packages/framework-integration-tests/tsconfig.integration.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "include": [ + "integration/**/*" + ], + "exclude": [ + "integration/fixtures/**/*" + ] +} \ No newline at end of file diff --git a/packages/framework-integration-tests/tsconfig.json b/packages/framework-integration-tests/tsconfig.json index 5fc49b853..c96b2c87b 100644 --- a/packages/framework-integration-tests/tsconfig.json +++ b/packages/framework-integration-tests/tsconfig.json @@ -6,7 +6,7 @@ "outDir": "dist", "rootDir": "src", "strict": true, - "target": "es2019", + "target": "ES2019", "noImplicitReturns": true, "noImplicitThis": true, "noUnusedLocals": true, diff --git a/packages/metadata-booster/README.md b/packages/metadata-booster/README.md index 30688d996..f699a69f9 100644 --- a/packages/metadata-booster/README.md +++ b/packages/metadata-booster/README.md @@ -1,7 +1,9 @@ # Metadata Booster + This is a transformer (also known as plugin) for Typescript to generate detailed metadata for all your classes. ## Why? + There are many applications that need to know the schema of your classes to work properly, like ORMs (to know the names of the database tables and columns), GraphQL APIs (to generate the GraphQL schema), etc. Currently, Typescript emits some metadata when you add decorators to your classes and enable the following compiler options: `"experimentalDecorators": true` and `"emitDecoratorMetadata": true`. @@ -9,6 +11,7 @@ Currently, Typescript emits some metadata when you add decorators to your classe However, that metadata is very limited, as it doesn't include property names and information about the type parameters. For example, if we had the following code: + ```typescript @AnyDecorator //We need to decorate the class to emit metadata class User { @@ -36,7 +39,9 @@ class Car { } } ``` + And now we call `Reflect.getMetadata('design:paramtypes')` on each class, we would get the following: + ```typescript Reflect.getMetadata('design:paramtypes', User) > [ [Function: String], [Function: Set] ] @@ -44,12 +49,15 @@ Reflect.getMetadata('design:paramtypes', User) Reflect.getMetadata('design:paramtypes', Car) > [ [Function: Number], [Function: Map] ] ``` + Not very helpful: we are lacking a lot of information about property names, type parameters and methods. ## Welcome to full detailed metadata + With this transformer, you will get much more detailed metadata for all your classes, without the need of using any decorator. Following with the previous example, you can get this detailed metadata using the key `'booster:typeinfo'`: + ```typescript Reflect.getMetadata('booster:typeinfo', User) > { @@ -129,49 +137,62 @@ Reflect.getMetadata('booster:typeinfo', Car) ] } ``` + As you can see, you can now have runtime access to the information about all the properties, type parameters, methods, return types, etc. of your classes. ## How to use it -"@boostercloud/metadata-booster" is a transformer so, until the Typescript team decides to accept plugins (you can track the status in [this issue](https://github.com/microsoft/TypeScript/issues/14419)), you would want to use the [Typescript](https://github.com/cevek/ttypescript) wrapper "TTypescript" to be able to use any transformer. That being said, it works really well. + +"@boostercloud/metadata-booster" is a transformer so, until the Typescript team decides to accept plugins (you can track the status in [this issue](https://github.com/microsoft/TypeScript/issues/14419)), you would want to use [TS Patch](https://github.com/nonara/ts-patch). Here are the steps: -1. Add the "@boostercloud/metadata-booster" transformer and "ttypescript" to your `"devDependencies"` -```shell -npm install --save-dev "@boostercloud/metadata-booster" -npm install --save-dev "ttypescript" -``` + +1. Add the "@boostercloud/metadata-booster" transformer and "ts-patch" to your `"devDependencies"` + + ```shell + npm install --save-dev "@boostercloud/metadata-booster" + npm install --save-dev "ts-patch" + ``` + 2. Add the official module "reflect-metadata" to your `"dependencies"` (you need this to access the metadata) -```shell -npm install --save-prod "reflect-metadata" -``` + + ```shell + npm install --save-prod "reflect-metadata" + ``` + 3. Go to your `tsconfig.json` file and - a) Ensure you have the option `"experimentalDecorators": true`. The reason is that the metadata is automatically added as a decorator to the class. In any case, you don't need to write any decorator. - b) Add "@boostercloud/metadata-booster" as a transformer plugin inside the `"compilerOptions"` section -```shell -{ - "compilerOptions": { - (...) - "experimentalDecorators": true - "plugins": [ - { "transform": "@boostercloud/metadata-booster"} - ] - }, -} -``` -4. _[Optional]_ From now on, to compile your code you need to use the command `ttsc` (the TTypescript wrapper), instead of `tsc`. I normally have a "build" script in my "package.json" file that calls `"tsc -b tsconfig.json"`, so I compile my code by running `npm run build`. I would recommend you to do that and change "tsc" by "ttsc". Like this: -```json - ... other "package.json" options fields ... - "scripts": { - "build": "ttsc -b tsconfig.json", - "test": "..." - } -``` + + ```shell + { + "compilerOptions": { + (...) + "experimentalDecorators": true + "plugins": [ + { "transform": "@boostercloud/metadata-booster"} + ] + }, + } + ``` + +4. Create a "prepare" script to patch your typescript installation automatically after installing your dependencies. You can also add a convenient "build" script in your "package.json" file to compile your code by running `npm run build` instead of calling the compiler directly: + + ```json + ... other "package.json" options fields ... + "scripts": { + "prepare": "ts-patch install -s", + "build": "tsc -b tsconfig.json", + "test": "..." + } + ``` Now you can compile your project by running `npm run build` and have access to a full detailed metadata for all your Typescript classes. ## Compatibility + This transformer is compatible with Typescript version 4.x.x ## Missing features + - [ ] Gather interfaces metadata - [ ] Gather method parameters metadata diff --git a/packages/metadata-booster/package.json b/packages/metadata-booster/package.json index f75b50b1e..7d2f06b7d 100644 --- a/packages/metadata-booster/package.json +++ b/packages/metadata-booster/package.json @@ -41,7 +41,7 @@ "@boostercloud/eslint-config": "workspace:^1.19.1", "@types/node": "^18.15.3", "ts-node": "^10.9.1", - "ttypescript": "1.5.15", + "ts-patch": "2.0.2", "typescript": "4.7.4", "prettier": "2.3.0", "sinon": "9.2.3", @@ -49,12 +49,13 @@ "eslint-plugin-unicorn": "~44.0.2" }, "scripts": { + "prepare": "ts-patch install -s", "lint:check": "eslint --ext '.js,.ts' **/*.ts", "lint:fix": "eslint --quiet --fix --ext '.js,.ts' **/*.ts", "build": "tsc -b tsconfig.json", "clean": "rimraf ./dist tsconfig.tsbuildinfo", "prepack": "tsc -b tsconfig.json", - "test": "ttsc -p tsconfig.test.json" + "test": "tsc -p tsconfig.test.json" }, "pnpm": { "overrides": { diff --git a/website/docs/10_going-deeper/data-migrations.md b/website/docs/10_going-deeper/data-migrations.md index 5dea8335d..8abb6e176 100644 --- a/website/docs/10_going-deeper/data-migrations.md +++ b/website/docs/10_going-deeper/data-migrations.md @@ -160,7 +160,7 @@ export class CartIdDataMigrateV2 { "typescript": "4.5.4", "ts-node": "9.1.1", "@types/node": "15.0.2", - "ttypescript": "1.5.15", + "ts-patch": "2.0.2", "@boostercloud/metadata-booster": "0.30.2" }, ```