From 21003af738157077b0c0711b203d4fbda46a496d Mon Sep 17 00:00:00 2001 From: proteriax <8125011+proteriax@users.noreply.github.com> Date: Thu, 22 Jul 2021 14:28:43 -0400 Subject: [PATCH] Test complete --- a.js | 45 + package.json | 3 +- pnpm-lock.yaml | 993 ++++++++++++++++++++ scripts/codegen.js | 5 + src/index.ts | 50 +- test/index.ts | 15 +- test/snapshots/privateProperties/.babelrc | 3 + test/snapshots/privateProperties/input.txt | 4 + test/snapshots/privateProperties/output.txt | 22 + 9 files changed, 1119 insertions(+), 21 deletions(-) create mode 100755 a.js create mode 100755 scripts/codegen.js create mode 100644 test/snapshots/privateProperties/.babelrc create mode 100644 test/snapshots/privateProperties/input.txt create mode 100644 test/snapshots/privateProperties/output.txt diff --git a/a.js b/a.js new file mode 100755 index 0000000..ae98514 --- /dev/null +++ b/a.js @@ -0,0 +1,45 @@ +#!/usr/bin/env node +const fs = require("fs") +const babel = require("@babel/core") + +const code = ` +export class A { + #a: string; +} +` + +const res = babel.transform(code, { + filename: "a.ts", + presets: [ + ["@babel/preset-env", { targets: { node: 14 } }], + ["@babel/preset-typescript"], + ], + plugins: [ + ({ types: t }) => ({ + visitor: { + ClassDeclaration(path, state) { + state.a ??= new WeakSet() + if (state.a.has(path.node)) { + return + } + state.a.add(path.node) + + path.parentPath.replaceWithMultiple([ + t.exportNamedDeclaration( + t.variableDeclaration("let", [ + t.variableDeclarator(path.node.id, { + ...path.node, + type: "ClassExpression", + }), + ]), + [], + null + ), + ]) + }, + }, + }), + ], +}) + +console.log(res.code) diff --git a/package.json b/package.json index 7bc1463..4d9c87c 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,12 @@ "scripts": { "test": "mocha test/**/*.ts", "build": "./scripts/build.js", - "postinstall": "mkdir -p lib; cd test/snapshots && ls | sed \"s/.*/'&'/\" | paste -sd '|' | sed -e \"s/^/export type Snapshot = /\" - > ../snapshots.d.ts" + "postinstall": "mkdir -p lib; ./scripts/codegen.js test/snapshots > test/snapshots.d.ts" }, "devDependencies": { "@babel/core": "^7.14.8", "@babel/plugin-transform-modules-commonjs": "^7.14.5", + "@babel/preset-env": "^7.14.8", "@babel/preset-typescript": "^7.14.5", "@babel/register": "^7.14.5", "@babel/types": "^7.14.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 11a4ba9..34e1664 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3,6 +3,7 @@ lockfileVersion: 5.3 specifiers: '@babel/core': ^7.14.8 '@babel/plugin-transform-modules-commonjs': ^7.14.5 + '@babel/preset-env': ^7.14.8 '@babel/preset-typescript': ^7.14.5 '@babel/register': ^7.14.5 '@babel/types': ^7.14.8 @@ -21,6 +22,7 @@ specifiers: devDependencies: '@babel/core': 7.14.8 '@babel/plugin-transform-modules-commonjs': 7.14.5_@babel+core@7.14.8 + '@babel/preset-env': 7.14.8_@babel+core@7.14.8 '@babel/preset-typescript': 7.14.5_@babel+core@7.14.8 '@babel/register': 7.14.5_@babel+core@7.14.8 '@babel/types': 7.14.8 @@ -89,6 +91,14 @@ packages: '@babel/types': 7.14.8 dev: true + /@babel/helper-builder-binary-assignment-operator-visitor/7.14.5: + resolution: {integrity: sha512-YTA/Twn0vBXDVGJuAX6PwW7x5zQei1luDDo2Pl6q1qZ7hVNl0RZrhHCQG/ArGpR29Vl7ETiB8eJyrvpuRp300w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-explode-assignable-expression': 7.14.5 + '@babel/types': 7.14.8 + dev: true + /@babel/helper-compilation-targets/7.14.5_@babel+core@7.14.8: resolution: {integrity: sha512-v+QtZqXEiOnpO6EYvlImB6zCD2Lel06RzOPzmkz/D/XgQiUu3C/Jb1LOqSt/AIA34TYi/Q+KlT8vTQrgdxkbLw==} engines: {node: '>=6.9.0'} @@ -119,6 +129,42 @@ packages: - supports-color dev: true + /@babel/helper-create-regexp-features-plugin/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-TLawwqpOErY2HhWbGJ2nZT5wSkR192QpN+nBg1THfBfftrlvOh+WbhrxXCH4q4xJ9Gl16BGPR/48JA+Ryiho/A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-annotate-as-pure': 7.14.5 + regexpu-core: 4.7.1 + dev: true + + /@babel/helper-define-polyfill-provider/0.2.3_@babel+core@7.14.8: + resolution: {integrity: sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew==} + peerDependencies: + '@babel/core': ^7.4.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-compilation-targets': 7.14.5_@babel+core@7.14.8 + '@babel/helper-module-imports': 7.14.5 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/traverse': 7.14.8 + debug: 4.3.2 + lodash.debounce: 4.0.8 + resolve: 1.20.0 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-explode-assignable-expression/7.14.5: + resolution: {integrity: sha512-Htb24gnGJdIGT4vnRKMdoXiOIlqOLmdiUYpAQ0mYfgVT/GDm8GOYhgi4GL+hMKrkiPRohO4ts34ELFsGAPQLDQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.14.8 + dev: true + /@babel/helper-function-name/7.14.5: resolution: {integrity: sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==} engines: {node: '>=6.9.0'} @@ -184,6 +230,17 @@ packages: engines: {node: '>=6.9.0'} dev: true + /@babel/helper-remap-async-to-generator/7.14.5: + resolution: {integrity: sha512-rLQKdQU+HYlxBwQIj8dk4/0ENOUEhA/Z0l4hN8BexpvmSMN9oA9EagjnhnDpNsRdWCfjwa4mn/HyBXO9yhQP6A==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-annotate-as-pure': 7.14.5 + '@babel/helper-wrap-function': 7.14.5 + '@babel/types': 7.14.8 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/helper-replace-supers/7.14.5: resolution: {integrity: sha512-3i1Qe9/8x/hCHINujn+iuHy+mMRLoc77b2nI9TB0zjH1hvn9qGlXjWlggdwUcju36PkPCy/lpM7LLUdcTyH4Ow==} engines: {node: '>=6.9.0'} @@ -203,6 +260,13 @@ packages: '@babel/types': 7.14.8 dev: true + /@babel/helper-skip-transparent-expression-wrappers/7.14.5: + resolution: {integrity: sha512-dmqZB7mrb94PZSAOYtr+ZN5qt5owZIAgqtoTuqiFbHFtxgEcmQlRJVI+bO++fciBunXtB6MK7HrzrfcAzIz2NQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.14.8 + dev: true + /@babel/helper-split-export-declaration/7.14.5: resolution: {integrity: sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==} engines: {node: '>=6.9.0'} @@ -220,6 +284,18 @@ packages: engines: {node: '>=6.9.0'} dev: true + /@babel/helper-wrap-function/7.14.5: + resolution: {integrity: sha512-YEdjTCq+LNuNS1WfxsDCNpgXkJaIyqco6DAelTUjT4f2KIWC1nBcaCaSdHTBqQVLnTBexBcVcFhLSU1KnYuePQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-function-name': 7.14.5 + '@babel/template': 7.14.5 + '@babel/traverse': 7.14.8 + '@babel/types': 7.14.8 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/helpers/7.14.8: resolution: {integrity: sha512-ZRDmI56pnV+p1dH6d+UN6GINGz7Krps3+270qqI9UJ4wxYThfAIcI5i7j5vXC4FJ3Wap+S9qcebxeYiqn87DZw==} engines: {node: '>=6.9.0'} @@ -246,6 +322,330 @@ packages: hasBin: true dev: true + /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-ZoJS2XCKPBfTmL122iP6NM9dOg+d4lc9fFk3zxc8iDjvt8Pk4+TlsHSKhIPf6X+L5ORCdBzqMZDjL/WHj7WknQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.13.0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.14.5 + '@babel/plugin-proposal-optional-chaining': 7.14.5_@babel+core@7.14.8 + dev: true + + /@babel/plugin-proposal-async-generator-functions/7.14.7_@babel+core@7.14.8: + resolution: {integrity: sha512-RK8Wj7lXLY3bqei69/cc25gwS5puEc3dknoFPFbqfy3XxYQBQFvu4ioWpafMBAB+L9NyptQK4nMOa5Xz16og8Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/helper-remap-async-to-generator': 7.14.5 + '@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.14.8 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-class-properties/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-q/PLpv5Ko4dVc1LYMpCY7RVAAO4uk55qPwrIuJ5QJ8c6cVuAmhu7I/49JOppXL6gXf7ZHzpRVEUZdYoPLM04Gg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-create-class-features-plugin': 7.14.8_@babel+core@7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-class-static-block/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-KBAH5ksEnYHCegqseI5N9skTdxgJdmDoAOc0uXa+4QMYKeZD0w5IARh4FMlTNtaHhbB8v+KzMdTgxMMzsIy6Yg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.12.0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-create-class-features-plugin': 7.14.8_@babel+core@7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/plugin-syntax-class-static-block': 7.14.5_@babel+core@7.14.8 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-dynamic-import/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-ExjiNYc3HDN5PXJx+bwC50GIx/KKanX2HiggnIUAYedbARdImiCU4RhhHfdf0Kd7JNXGpsBBBCOm+bBVy3Gb0g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/plugin-syntax-dynamic-import': 7.8.3_@babel+core@7.14.8 + dev: true + + /@babel/plugin-proposal-export-namespace-from/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-g5POA32bXPMmSBu5Dx/iZGLGnKmKPc5AiY7qfZgurzrCYgIztDlHFbznSNCoQuv57YQLnQfaDi7dxCtLDIdXdA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/plugin-syntax-export-namespace-from': 7.8.3_@babel+core@7.14.8 + dev: true + + /@babel/plugin-proposal-json-strings/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-NSq2fczJYKVRIsUJyNxrVUMhB27zb7N7pOFGQOhBKJrChbGcgEAqyZrmZswkPk18VMurEeJAaICbfm57vUeTbQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.14.8 + dev: true + + /@babel/plugin-proposal-logical-assignment-operators/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-YGn2AvZAo9TwyhlLvCCWxD90Xq8xJ4aSgaX3G5D/8DW94L8aaT+dS5cSP+Z06+rCJERGSr9GxMBZ601xoc2taw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.14.8 + dev: true + + /@babel/plugin-proposal-nullish-coalescing-operator/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-gun/SOnMqjSb98Nkaq2rTKMwervfdAoz6NphdY0vTfuzMfryj+tDGb2n6UkDKwez+Y8PZDhE3D143v6Gepp4Hg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.14.8 + dev: true + + /@babel/plugin-proposal-numeric-separator/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-yiclALKe0vyZRZE0pS6RXgjUOt87GWv6FYa5zqj15PvhOGFO69R5DusPlgK/1K5dVnCtegTiWu9UaBSrLLJJBg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.14.8 + dev: true + + /@babel/plugin-proposal-object-rest-spread/7.14.7_@babel+core@7.14.8: + resolution: {integrity: sha512-082hsZz+sVabfmDWo1Oct1u1AgbKbUAyVgmX4otIc7bdsRgHBXwTwb3DpDmD4Eyyx6DNiuz5UAATT655k+kL5g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.14.7 + '@babel/core': 7.14.8 + '@babel/helper-compilation-targets': 7.14.5_@babel+core@7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.14.8 + '@babel/plugin-transform-parameters': 7.14.5_@babel+core@7.14.8 + dev: true + + /@babel/plugin-proposal-optional-catch-binding/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-3Oyiixm0ur7bzO5ybNcZFlmVsygSIQgdOa7cTfOYCMY+wEPAYhZAJxi3mixKFCTCKUhQXuCTtQ1MzrpL3WT8ZQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.14.8 + dev: true + + /@babel/plugin-proposal-optional-chaining/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-ycz+VOzo2UbWNI1rQXxIuMOzrDdHGrI23fRiz/Si2R4kv2XZQ1BK8ccdHwehMKBlcH/joGW/tzrUmo67gbJHlQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.14.5 + '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.14.8 + dev: true + + /@babel/plugin-proposal-private-methods/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-838DkdUA1u+QTCplatfq4B7+1lnDa/+QMI89x5WZHBcnNv+47N8QEj2k9I2MUU9xIv8XJ4XvPCviM/Dj7Uwt9g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-create-class-features-plugin': 7.14.8_@babel+core@7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-private-property-in-object/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-62EyfyA3WA0mZiF2e2IV9mc9Ghwxcg8YTu8BS4Wss4Y3PY725OmS9M0qLORbJwLqFtGh+jiE4wAmocK2CTUK2Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-annotate-as-pure': 7.14.5 + '@babel/helper-create-class-features-plugin': 7.14.8_@babel+core@7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/plugin-syntax-private-property-in-object': 7.14.5_@babel+core@7.14.8 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-unicode-property-regex/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-6axIeOU5LnY471KenAB9vI8I5j7NQ2d652hIYwVyRfgaZT5UpiqFKCuVXCDMSrU+3VFafnu2c5m3lrWIlr6A5Q==} + engines: {node: '>=4'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-create-regexp-features-plugin': 7.14.5_@babel+core@7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.14.8: + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.14.8: + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-class-static-block/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-dynamic-import/7.8.3_@babel+core@7.14.8: + resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-export-namespace-from/7.8.3_@babel+core@7.14.8: + resolution: {integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.14.8: + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.14.8: + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-nullish-coalescing-operator/7.8.3_@babel+core@7.14.8: + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-numeric-separator/7.10.4_@babel+core@7.14.8: + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.14.8: + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-optional-catch-binding/7.8.3_@babel+core@7.14.8: + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-optional-chaining/7.8.3_@babel+core@7.14.8: + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-private-property-in-object/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-syntax-top-level-await/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + /@babel/plugin-syntax-typescript/7.14.5_@babel+core@7.14.8: resolution: {integrity: sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q==} engines: {node: '>=6.9.0'} @@ -256,6 +656,175 @@ packages: '@babel/helper-plugin-utils': 7.14.5 dev: true + /@babel/plugin-transform-arrow-functions/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-async-to-generator/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-szkbzQ0mNk0rpu76fzDdqSyPu0MuvpXgC+6rz5rpMb5OIRxdmHfQxrktL8CYolL2d8luMCZTR0DpIMIdL27IjA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-module-imports': 7.14.5 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/helper-remap-async-to-generator': 7.14.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-block-scoped-functions/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-block-scoping/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-LBYm4ZocNgoCqyxMLoOnwpsmQ18HWTQvql64t3GvMUzLQrNoV1BDG0lNftC8QKYERkZgCCT/7J5xWGObGAyHDw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-classes/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-J4VxKAMykM06K/64z9rwiL6xnBHgB1+FVspqvlgCdwD1KUbQNfszeKVVOMh59w3sztHYIZDgnhOC4WbdEfHFDA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-annotate-as-pure': 7.14.5 + '@babel/helper-function-name': 7.14.5 + '@babel/helper-optimise-call-expression': 7.14.5 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/helper-replace-supers': 7.14.5 + '@babel/helper-split-export-declaration': 7.14.5 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-computed-properties/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-destructuring/7.14.7_@babel+core@7.14.8: + resolution: {integrity: sha512-0mDE99nK+kVh3xlc5vKwB6wnP9ecuSj+zQCa/n0voENtP/zymdT4HH6QEb65wjjcbqr1Jb/7z9Qp7TF5FtwYGw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-dotall-regex/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-loGlnBdj02MDsFaHhAIJzh7euK89lBrGIdM9EAtHFo6xKygCUGuuWe07o1oZVk287amtW1n0808sQM99aZt3gw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-create-regexp-features-plugin': 7.14.5_@babel+core@7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-duplicate-keys/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-iJjbI53huKbPDAsJ8EmVmvCKeeq21bAze4fu9GBQtSLqfvzj2oRuHVx4ZkDwEhg1htQ+5OBZh/Ab0XDf5iBZ7A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-exponentiation-operator/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-jFazJhMBc9D27o9jDnIE5ZErI0R0m7PbKXVq77FFvqFbzvTMuv8jaAwLZ5PviOLSFttqKIW0/wxNSDbjLk0tYA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-builder-binary-assignment-operator-visitor': 7.14.5 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-for-of/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-CfmqxSUZzBl0rSjpoQSFoR9UEj3HzbGuGNL21/iFTmjb5gFggJp3ph0xR1YBhexmLoKRHzgxuFvty2xdSt6gTA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-function-name/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-function-name': 7.14.5 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-literals/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-member-expression-literals/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-WkNXxH1VXVTKarWFqmso83xl+2V3Eo28YY5utIkbsmXoItO8Q3aZxN4BTS2k0hz9dGUloHK26mJMyQEYfkn/+Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-modules-amd/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-3lpOU8Vxmp3roC4vzFpSdEpGUWSMsHFreTWOMMLzel2gNGfHE5UWIh/LN6ghHs2xurUp4jRFYMUIZhuFbody1g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-module-transforms': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + babel-plugin-dynamic-import-node: 2.3.3 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/plugin-transform-modules-commonjs/7.14.5_@babel+core@7.14.8: resolution: {integrity: sha512-en8GfBtgnydoao2PS+87mKyw62k02k7kJ9ltbKe0fXTHrQmG6QZZflYuGI1VVG7sVpx4E1n7KBpNlPb8m78J+A==} engines: {node: '>=6.9.0'} @@ -271,6 +840,159 @@ packages: - supports-color dev: true + /@babel/plugin-transform-modules-systemjs/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-mNMQdvBEE5DcMQaL5LbzXFMANrQjd2W7FPzg34Y4yEz7dBgdaC+9B84dSO+/1Wba98zoDbInctCDo4JGxz1VYA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-hoist-variables': 7.14.5 + '@babel/helper-module-transforms': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/helper-validator-identifier': 7.14.8 + babel-plugin-dynamic-import-node: 2.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-modules-umd/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-RfPGoagSngC06LsGUYyM9QWSXZ8MysEjDJTAea1lqRjNECE3y0qIJF/qbvJxc4oA4s99HumIMdXOrd+TdKaAAA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-module-transforms': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-named-capturing-groups-regex/7.14.7_@babel+core@7.14.8: + resolution: {integrity: sha512-DTNOTaS7TkW97xsDMrp7nycUVh6sn/eq22VaxWfEdzuEbRsiaOU0pqU7DlyUGHVsbQbSghvjKRpEl+nUCKGQSg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-create-regexp-features-plugin': 7.14.5_@babel+core@7.14.8 + dev: true + + /@babel/plugin-transform-new-target/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-Nx054zovz6IIRWEB49RDRuXGI4Gy0GMgqG0cII9L3MxqgXz/+rgII+RU58qpo4g7tNEx1jG7rRVH4ihZoP4esQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-object-super/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/helper-replace-supers': 7.14.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-parameters/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-Tl7LWdr6HUxTmzQtzuU14SqbgrSKmaR77M0OKyq4njZLQTPfOvzblNKyNkGwOfEFCEx7KeYHQHDI0P3F02IVkA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-property-literals/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-r1uilDthkgXW8Z1vJz2dKYLV1tuw2xsbrp3MrZmD99Wh9vsfKoob+JTgri5VUb/JqyKRXotlOtwgu4stIYCmnw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-regenerator/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + regenerator-transform: 0.14.5 + dev: true + + /@babel/plugin-transform-reserved-words/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-cv4F2rv1nD4qdexOGsRQXJrOcyb5CrgjUH9PKrrtyhSDBNWGxd0UIitjyJiWagS+EbUGjG++22mGH1Pub8D6Vg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-shorthand-properties/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-spread/7.14.6_@babel+core@7.14.8: + resolution: {integrity: sha512-Zr0x0YroFJku7n7+/HH3A2eIrGMjbmAIbJSVv0IZ+t3U2WUQUA64S/oeied2e+MaGSjmt4alzBCsK9E8gh+fag==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.14.5 + dev: true + + /@babel/plugin-transform-sticky-regex/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-Z7F7GyvEMzIIbwnziAZmnSNpdijdr4dWt+FJNBnBLz5mwDFkqIXU9wmBcWWad3QeJF5hMTkRe4dAq2sUZiG+8A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-template-literals/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-typeof-symbol/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-lXzLD30ffCWseTbMQzrvDWqljvZlHkXU+CnseMhkMNqU1sASnCsz3tSzAaH3vCUXb9PHeUb90ZT1BdFTm1xxJw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + /@babel/plugin-transform-typescript/7.14.6_@babel+core@7.14.8: resolution: {integrity: sha512-XlTdBq7Awr4FYIzqhmYY80WN0V0azF74DMPyFqVHBvf81ZUgc4X7ZOpx6O8eLDK6iM5cCQzeyJw0ynTaefixRA==} engines: {node: '>=6.9.0'} @@ -285,6 +1007,124 @@ packages: - supports-color dev: true + /@babel/plugin-transform-unicode-escapes/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-crTo4jATEOjxj7bt9lbYXcBAM3LZaUrbP2uUdxb6WIorLmjNKSpHfIybgY4B8SRpbf8tEVIWH3Vtm7ayCrKocA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/plugin-transform-unicode-regex/7.14.5_@babel+core@7.14.8: + resolution: {integrity: sha512-UygduJpC5kHeCiRw/xDVzC+wj8VaYSoKl5JNVmbP7MadpNinAm3SvZCxZ42H37KZBKztz46YC73i9yV34d0Tzw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-create-regexp-features-plugin': 7.14.5_@babel+core@7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + dev: true + + /@babel/preset-env/7.14.8_@babel+core@7.14.8: + resolution: {integrity: sha512-a9aOppDU93oArQ51H+B8M1vH+tayZbuBqzjOhntGetZVa+4tTu5jp+XTwqHGG2lxslqomPYVSjIxQkFwXzgnxg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.14.7 + '@babel/core': 7.14.8 + '@babel/helper-compilation-targets': 7.14.5_@babel+core@7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/helper-validator-option': 7.14.5 + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-proposal-async-generator-functions': 7.14.7_@babel+core@7.14.8 + '@babel/plugin-proposal-class-properties': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-proposal-class-static-block': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-proposal-dynamic-import': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-proposal-export-namespace-from': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-proposal-json-strings': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-proposal-logical-assignment-operators': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-proposal-nullish-coalescing-operator': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-proposal-numeric-separator': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-proposal-object-rest-spread': 7.14.7_@babel+core@7.14.8 + '@babel/plugin-proposal-optional-catch-binding': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-proposal-optional-chaining': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-proposal-private-methods': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-proposal-private-property-in-object': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-proposal-unicode-property-regex': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.14.8 + '@babel/plugin-syntax-class-properties': 7.12.13_@babel+core@7.14.8 + '@babel/plugin-syntax-class-static-block': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-syntax-dynamic-import': 7.8.3_@babel+core@7.14.8 + '@babel/plugin-syntax-export-namespace-from': 7.8.3_@babel+core@7.14.8 + '@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.14.8 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.14.8 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.14.8 + '@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.14.8 + '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.14.8 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.14.8 + '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.14.8 + '@babel/plugin-syntax-private-property-in-object': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-syntax-top-level-await': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-arrow-functions': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-async-to-generator': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-block-scoped-functions': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-block-scoping': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-classes': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-computed-properties': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-destructuring': 7.14.7_@babel+core@7.14.8 + '@babel/plugin-transform-dotall-regex': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-duplicate-keys': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-exponentiation-operator': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-for-of': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-function-name': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-literals': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-member-expression-literals': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-modules-amd': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-modules-commonjs': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-modules-systemjs': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-modules-umd': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-named-capturing-groups-regex': 7.14.7_@babel+core@7.14.8 + '@babel/plugin-transform-new-target': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-object-super': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-parameters': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-property-literals': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-regenerator': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-reserved-words': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-shorthand-properties': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-spread': 7.14.6_@babel+core@7.14.8 + '@babel/plugin-transform-sticky-regex': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-template-literals': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-typeof-symbol': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-unicode-escapes': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-unicode-regex': 7.14.5_@babel+core@7.14.8 + '@babel/preset-modules': 0.1.4_@babel+core@7.14.8 + '@babel/types': 7.14.8 + babel-plugin-polyfill-corejs2: 0.2.2_@babel+core@7.14.8 + babel-plugin-polyfill-corejs3: 0.2.3_@babel+core@7.14.8 + babel-plugin-polyfill-regenerator: 0.2.2_@babel+core@7.14.8 + core-js-compat: 3.15.2 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/preset-modules/0.1.4_@babel+core@7.14.8: + resolution: {integrity: sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-plugin-utils': 7.14.5 + '@babel/plugin-proposal-unicode-property-regex': 7.14.5_@babel+core@7.14.8 + '@babel/plugin-transform-dotall-regex': 7.14.5_@babel+core@7.14.8 + '@babel/types': 7.14.8 + esutils: 2.0.3 + dev: true + /@babel/preset-typescript/7.14.5_@babel+core@7.14.8: resolution: {integrity: sha512-u4zO6CdbRKbS9TypMqrlGH7sd2TAJppZwn3c/ZRLeO/wGsbddxgbPDUZVNrie3JWYLQ9vpineKlsrWFvO6Pwkw==} engines: {node: '>=6.9.0'} @@ -313,6 +1153,13 @@ packages: source-map-support: 0.5.19 dev: true + /@babel/runtime/7.14.8: + resolution: {integrity: sha512-twj3L8Og5SaCRCErB4x4ajbvBIVV77CGeFglHpeg5WC5FF8TZzBWXtTJ4MqaD9QszLYTtr+IsaAL2rEUevb+eg==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.13.7 + dev: true + /@babel/template/7.14.5: resolution: {integrity: sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==} engines: {node: '>=6.9.0'} @@ -468,6 +1315,42 @@ packages: object.assign: 4.1.2 dev: true + /babel-plugin-polyfill-corejs2/0.2.2_@babel+core@7.14.8: + resolution: {integrity: sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.14.7 + '@babel/core': 7.14.8 + '@babel/helper-define-polyfill-provider': 0.2.3_@babel+core@7.14.8 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-polyfill-corejs3/0.2.3_@babel+core@7.14.8: + resolution: {integrity: sha512-rCOFzEIJpJEAU14XCcV/erIf/wZQMmMT5l5vXOpL5uoznyOGfDIjPj6FVytMvtzaKSTSVKouOCTPJ5OMUZH30g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-define-polyfill-provider': 0.2.3_@babel+core@7.14.8 + core-js-compat: 3.15.2 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-polyfill-regenerator/0.2.2_@babel+core@7.14.8: + resolution: {integrity: sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.14.8 + '@babel/helper-define-polyfill-provider': 0.2.3_@babel+core@7.14.8 + transitivePeerDependencies: + - supports-color + dev: true + /balanced-match/1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true @@ -644,6 +1527,13 @@ packages: safe-buffer: 5.1.2 dev: true + /core-js-compat/3.15.2: + resolution: {integrity: sha512-Wp+BJVvwopjI+A1EFqm2dwUmWYXrvucmtIB2LgXn/Rb+gWPKYxtmb4GKHGKG/KGF1eK9jfjzT38DITbTOCX/SQ==} + dependencies: + browserslist: 4.16.6 + semver: 7.0.0 + dev: true + /create-require/1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true @@ -742,6 +1632,11 @@ packages: engines: {node: '>=10'} dev: true + /esutils/2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: true + /fill-range/7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} @@ -905,6 +1800,12 @@ packages: binary-extensions: 2.2.0 dev: true + /is-core-module/2.5.0: + resolution: {integrity: sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg==} + dependencies: + has: 1.0.3 + dev: true + /is-extglob/2.1.1: resolution: {integrity: sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=} engines: {node: '>=0.10.0'} @@ -969,6 +1870,11 @@ packages: argparse: 2.0.1 dev: true + /jsesc/0.5.0: + resolution: {integrity: sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=} + hasBin: true + dev: true + /jsesc/2.5.2: resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} engines: {node: '>=4'} @@ -1013,6 +1919,10 @@ packages: p-locate: 5.0.0 dev: true + /lodash.debounce/4.0.8: + resolution: {integrity: sha1-gteb/zCmfEAF/9XiUVMArZyk168=} + dev: true + /lodash.isempty/4.4.0: resolution: {integrity: sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=} dev: true @@ -1241,6 +2151,10 @@ packages: engines: {node: '>=0.10.0'} dev: true + /path-parse/1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + /pathval/1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} dev: true @@ -1300,6 +2214,50 @@ packages: picomatch: 2.3.0 dev: true + /regenerate-unicode-properties/8.2.0: + resolution: {integrity: sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==} + engines: {node: '>=4'} + dependencies: + regenerate: 1.4.2 + dev: true + + /regenerate/1.4.2: + resolution: {integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==} + dev: true + + /regenerator-runtime/0.13.7: + resolution: {integrity: sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==} + dev: true + + /regenerator-transform/0.14.5: + resolution: {integrity: sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==} + dependencies: + '@babel/runtime': 7.14.8 + dev: true + + /regexpu-core/4.7.1: + resolution: {integrity: sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==} + engines: {node: '>=4'} + dependencies: + regenerate: 1.4.2 + regenerate-unicode-properties: 8.2.0 + regjsgen: 0.5.2 + regjsparser: 0.6.9 + unicode-match-property-ecmascript: 1.0.4 + unicode-match-property-value-ecmascript: 1.2.0 + dev: true + + /regjsgen/0.5.2: + resolution: {integrity: sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==} + dev: true + + /regjsparser/0.6.9: + resolution: {integrity: sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==} + hasBin: true + dependencies: + jsesc: 0.5.0 + dev: true + /require-directory/2.1.1: resolution: {integrity: sha1-jGStX9MNqxyXbiNE/+f3kqam30I=} engines: {node: '>=0.10.0'} @@ -1309,6 +2267,13 @@ packages: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} dev: true + /resolve/1.20.0: + resolution: {integrity: sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==} + dependencies: + is-core-module: 2.5.0 + path-parse: 1.0.7 + dev: true + /safe-buffer/5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} dev: true @@ -1323,6 +2288,11 @@ packages: hasBin: true dev: true + /semver/7.0.0: + resolution: {integrity: sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==} + hasBin: true + dev: true + /serialize-javascript/6.0.0: resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} dependencies: @@ -1492,6 +2462,29 @@ packages: hasBin: true dev: true + /unicode-canonical-property-names-ecmascript/1.0.4: + resolution: {integrity: sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==} + engines: {node: '>=4'} + dev: true + + /unicode-match-property-ecmascript/1.0.4: + resolution: {integrity: sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==} + engines: {node: '>=4'} + dependencies: + unicode-canonical-property-names-ecmascript: 1.0.4 + unicode-property-aliases-ecmascript: 1.1.0 + dev: true + + /unicode-match-property-value-ecmascript/1.2.0: + resolution: {integrity: sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==} + engines: {node: '>=4'} + dev: true + + /unicode-property-aliases-ecmascript/1.1.0: + resolution: {integrity: sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==} + engines: {node: '>=4'} + dev: true + /universalify/0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} diff --git a/scripts/codegen.js b/scripts/codegen.js new file mode 100755 index 0000000..5f14bc8 --- /dev/null +++ b/scripts/codegen.js @@ -0,0 +1,5 @@ +#!/usr/bin/env node +const fs = require("fs") +const [arg] = process.argv.slice(2) +const files = fs.readdirSync(arg).filter(name => name[0] !== ".") +console.log("export type Snapshot = " + files.map(v => JSON.stringify(v)).join(" | ")) diff --git a/src/index.ts b/src/index.ts index 82dbb4b..bd1e1bd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -50,9 +50,10 @@ export default ({ types: t }: typeof babel): babel.PluginObj => ({ if (state.visited.has(path.node)) return state.visited.add(path.node) - const modifiers: (t.Expression | t.Statement)[] = [] + const suffix: (t.Expression | t.Statement)[] = [] const classDecorators: t.Expression[] = [] const prefixes: t.Statement[] = [] + let replace = true const classID = path.node.id @@ -66,9 +67,14 @@ export default ({ types: t }: typeof babel): babel.PluginObj => ({ for (const child of path.node.body.body) { switch (child.type) { + case "ClassPrivateMethod": + case "ClassPrivateProperty": + replace = false + break + case "ClassProperty": if (!child.decorators) break - modifiers.push( + suffix.push( t.callExpression(state.__decorate(), [ t.arrayExpression(child.decorators.map(d => d.expression)), child.static @@ -119,7 +125,7 @@ export default ({ types: t }: typeof babel): babel.PluginObj => ({ if (!list.length) break - modifiers.push( + suffix.push( t.callExpression(state.__decorate(), [ t.arrayExpression(list), t.memberExpression(classID, t.identifier("prototype")), @@ -133,16 +139,16 @@ export default ({ types: t }: typeof babel): babel.PluginObj => ({ } } - if (!classDecorators.length && !modifiers.length && !prefixes.length) return + if (!classDecorators.length && !suffix.length && !prefixes.length) return + let replaceWith: t.Statement | undefined - const replacees: t.Statement[] = prefixes.slice() if (classDecorators.length) { - replacees.push( - t.variableDeclaration("let", [ + if (replace) { + replaceWith = t.variableDeclaration("let", [ t.variableDeclarator(classID, { ...path.node, type: "ClassExpression" }), ]) - ) - modifiers.push( + } + suffix.push( t.assignmentExpression( "=", classID, @@ -154,27 +160,35 @@ export default ({ types: t }: typeof babel): babel.PluginObj => ({ ) if (isNamedExport) { - modifiers.push( + suffix.push( t.exportNamedDeclaration(undefined, [t.exportSpecifier(classID, classID)]) ) } else if (isDefaultExport) { - modifiers.push(t.exportDefaultDeclaration(classID)) + suffix.push(t.exportDefaultDeclaration(classID)) } - } else { + } else if (replace) { let node: t.Statement = path.node if (isNamedExport) { node = t.exportNamedDeclaration(node, [], null) } else if (isDefaultExport) { node = t.exportDefaultDeclaration(node) } - replacees.push(node) + replaceWith = node } - replacees.push( - ...modifiers.map(e => (t.isStatement(e) ? e : t.expressionStatement(e))) - ) - const replacementTarget = isNamedExport || isDefaultExport ? path.parentPath : path - replacementTarget.replaceWithMultiple(replacees) + const pathInContext = isNamedExport || isDefaultExport ? path.parentPath : path + if (prefixes.length) { + pathInContext.insertBefore(prefixes) + } + if (suffix.length) { + const nodes = suffix.map(s => (t.isStatement(s) ? s : t.expressionStatement(s))) + if (replace) { + const [newPath] = pathInContext.replaceWith(replaceWith!) + newPath.insertAfter(nodes) + } else { + pathInContext.insertAfter(nodes) + } + } }, }, }) diff --git a/test/index.ts b/test/index.ts index f8869ce..cb83a8f 100644 --- a/test/index.ts +++ b/test/index.ts @@ -1,4 +1,4 @@ -import { readFileSync } from "fs" +import { readFileSync, existsSync } from "fs" import { describe, it } from "mocha" import { resolve } from "path" import { expect } from "chai" @@ -14,13 +14,20 @@ const equal = (name: Snapshot) => { const folder = resolve(__dirname, "snapshots", name) const actual = readFileSync(resolve(folder, "input.txt"), "utf-8") const expected = readFileSync(resolve(folder, "output.txt"), "utf-8") + const babelrc: babel.TransformOptions = existsSync(resolve(folder, ".babelrc")) + ? JSON.parse(readFileSync(resolve(folder, ".babelrc"), "utf-8")) + : {} + const transformed = transform(actual, { parserOpts: { + ...babelrc.parserOpts, plugins: ["decorators-legacy", "typescript"], }, babelrc: false, configFile: false, + presets: babelrc.presets, plugins: [ + ...(babelrc.plugins ?? []), plugin, { visitor: { @@ -52,11 +59,15 @@ describe("tsc-decorator", () => { equal("computedProperties") }) - it("works with class/consrtuctor decorators", () => { + it("works with class/constructor decorators", () => { equal("constructor") }) it("does not interfere with export declarations", () => { equal("exports") }) + + it("works with private properties", () => { + equal("privateProperties") + }) }) diff --git a/test/snapshots/privateProperties/.babelrc b/test/snapshots/privateProperties/.babelrc new file mode 100644 index 0000000..5c676bb --- /dev/null +++ b/test/snapshots/privateProperties/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": [["@babel/preset-env", { "targets": { "node": 14 } }]] +} diff --git a/test/snapshots/privateProperties/input.txt b/test/snapshots/privateProperties/input.txt new file mode 100644 index 0000000..e25bab1 --- /dev/null +++ b/test/snapshots/privateProperties/input.txt @@ -0,0 +1,4 @@ +@Service() +export class B { + #remote: Service +} \ No newline at end of file diff --git a/test/snapshots/privateProperties/output.txt b/test/snapshots/privateProperties/output.txt new file mode 100644 index 0000000..2ed2a1e --- /dev/null +++ b/test/snapshots/privateProperties/output.txt @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true, +}); + +exports.B = exports.B = void 0; + +var _tslib = require("tslib"); +var _remote = /*#__PURE__*/ new WeakMap(); + +exports.B = exports.B = B = (0, _tslib.__decorate)([Service()], B); + +class B { + constructor() { + _remote.set(this, { + writable: true, + value: void 0, + }); + } +} + +exports.B = exports.B = B;