├── .gitignore ├── .npmignore ├── .nvmrc ├── .prettierrc ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── src ├── index.ts └── renderTemplate.ts ├── template ├── .eslintrc.js ├── .github │ └── workflows │ │ ├── node.js.yml │ │ └── test.yml ├── .gitignore ├── .npmignore.keep ├── .nvmrc ├── .prettierrc ├── LICENSE ├── README.md ├── esbuild.js ├── package.json ├── src │ ├── index.test.ts │ └── index.ts ├── tsconfig.build.json ├── tsconfig.json └── vitest.config.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | 106 | .vscode 107 | 108 | template/package-lock.json 109 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | ./src 2 | !template/.gitignore 3 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 20 -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "semi": false 4 | } 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # create-managed-component 2 | 3 | An easy way to create a Managed Component 4 | 5 | ## Usage 6 | 7 | ```sh 8 | npm init managed-component 9 | ``` 10 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-managed-component", 3 | "version": "1.3.6", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "create-managed-component", 9 | "version": "1.3.6", 10 | "license": "Apache-2.0", 11 | "dependencies": { 12 | "chalk": "^4.1.2", 13 | "locreq": "^2.1.0", 14 | "minimist": "^1.2.6", 15 | "prompts": "^2.4.2" 16 | }, 17 | "bin": { 18 | "create-mc": "dist/index.js" 19 | }, 20 | "devDependencies": { 21 | "@types/minimist": "^1.2.2", 22 | "@types/prompts": "^2.0.14", 23 | "ts-node": "^10.8.1", 24 | "typescript": "^4.7.4" 25 | }, 26 | "engines": { 27 | "node": ">18.0.0" 28 | } 29 | }, 30 | "node_modules/@cspotcode/source-map-support": { 31 | "version": "0.8.1", 32 | "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", 33 | "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", 34 | "dev": true, 35 | "dependencies": { 36 | "@jridgewell/trace-mapping": "0.3.9" 37 | }, 38 | "engines": { 39 | "node": ">=12" 40 | } 41 | }, 42 | "node_modules/@jridgewell/resolve-uri": { 43 | "version": "3.0.7", 44 | "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", 45 | "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", 46 | "dev": true, 47 | "engines": { 48 | "node": ">=6.0.0" 49 | } 50 | }, 51 | "node_modules/@jridgewell/sourcemap-codec": { 52 | "version": "1.4.13", 53 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", 54 | "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", 55 | "dev": true 56 | }, 57 | "node_modules/@jridgewell/trace-mapping": { 58 | "version": "0.3.9", 59 | "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", 60 | "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", 61 | "dev": true, 62 | "dependencies": { 63 | "@jridgewell/resolve-uri": "^3.0.3", 64 | "@jridgewell/sourcemap-codec": "^1.4.10" 65 | } 66 | }, 67 | "node_modules/@tsconfig/node10": { 68 | "version": "1.0.9", 69 | "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", 70 | "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", 71 | "dev": true 72 | }, 73 | "node_modules/@tsconfig/node12": { 74 | "version": "1.0.11", 75 | "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", 76 | "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", 77 | "dev": true 78 | }, 79 | "node_modules/@tsconfig/node14": { 80 | "version": "1.0.3", 81 | "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", 82 | "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", 83 | "dev": true 84 | }, 85 | "node_modules/@tsconfig/node16": { 86 | "version": "1.0.3", 87 | "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", 88 | "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", 89 | "dev": true 90 | }, 91 | "node_modules/@types/minimist": { 92 | "version": "1.2.2", 93 | "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", 94 | "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", 95 | "dev": true 96 | }, 97 | "node_modules/@types/node": { 98 | "version": "18.0.0", 99 | "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.0.tgz", 100 | "integrity": "sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==", 101 | "dev": true 102 | }, 103 | "node_modules/@types/prompts": { 104 | "version": "2.0.14", 105 | "resolved": "https://registry.npmjs.org/@types/prompts/-/prompts-2.0.14.tgz", 106 | "integrity": "sha512-HZBd99fKxRWpYCErtm2/yxUZv6/PBI9J7N4TNFffl5JbrYMHBwF25DjQGTW3b3jmXq+9P6/8fCIb2ee57BFfYA==", 107 | "dev": true, 108 | "dependencies": { 109 | "@types/node": "*" 110 | } 111 | }, 112 | "node_modules/acorn": { 113 | "version": "8.7.1", 114 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", 115 | "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", 116 | "dev": true, 117 | "bin": { 118 | "acorn": "bin/acorn" 119 | }, 120 | "engines": { 121 | "node": ">=0.4.0" 122 | } 123 | }, 124 | "node_modules/acorn-walk": { 125 | "version": "8.2.0", 126 | "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", 127 | "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", 128 | "dev": true, 129 | "engines": { 130 | "node": ">=0.4.0" 131 | } 132 | }, 133 | "node_modules/ansi-styles": { 134 | "version": "4.3.0", 135 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 136 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 137 | "dependencies": { 138 | "color-convert": "^2.0.1" 139 | }, 140 | "engines": { 141 | "node": ">=8" 142 | }, 143 | "funding": { 144 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 145 | } 146 | }, 147 | "node_modules/arg": { 148 | "version": "4.1.3", 149 | "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", 150 | "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", 151 | "dev": true 152 | }, 153 | "node_modules/chalk": { 154 | "version": "4.1.2", 155 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 156 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 157 | "dependencies": { 158 | "ansi-styles": "^4.1.0", 159 | "supports-color": "^7.1.0" 160 | }, 161 | "engines": { 162 | "node": ">=10" 163 | }, 164 | "funding": { 165 | "url": "https://github.com/chalk/chalk?sponsor=1" 166 | } 167 | }, 168 | "node_modules/color-convert": { 169 | "version": "2.0.1", 170 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 171 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 172 | "dependencies": { 173 | "color-name": "~1.1.4" 174 | }, 175 | "engines": { 176 | "node": ">=7.0.0" 177 | } 178 | }, 179 | "node_modules/color-name": { 180 | "version": "1.1.4", 181 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 182 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" 183 | }, 184 | "node_modules/create-require": { 185 | "version": "1.1.1", 186 | "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", 187 | "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", 188 | "dev": true 189 | }, 190 | "node_modules/diff": { 191 | "version": "4.0.2", 192 | "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", 193 | "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", 194 | "dev": true, 195 | "engines": { 196 | "node": ">=0.3.1" 197 | } 198 | }, 199 | "node_modules/has-flag": { 200 | "version": "4.0.0", 201 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 202 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 203 | "engines": { 204 | "node": ">=8" 205 | } 206 | }, 207 | "node_modules/kleur": { 208 | "version": "3.0.3", 209 | "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", 210 | "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", 211 | "engines": { 212 | "node": ">=6" 213 | } 214 | }, 215 | "node_modules/locreq": { 216 | "version": "2.1.0", 217 | "resolved": "https://registry.npmjs.org/locreq/-/locreq-2.1.0.tgz", 218 | "integrity": "sha512-dB5vXhfq+imVNmAEAxKldmyxtTorplZVudgewOXjhEJpgk9aJ0G2YxRU8FHwnibADnyiLwo6kzrQrc/LD1kcWQ==", 219 | "dependencies": { 220 | "@types/node": "^14.14.16" 221 | } 222 | }, 223 | "node_modules/locreq/node_modules/@types/node": { 224 | "version": "14.18.63", 225 | "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", 226 | "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==" 227 | }, 228 | "node_modules/make-error": { 229 | "version": "1.3.6", 230 | "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", 231 | "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", 232 | "dev": true 233 | }, 234 | "node_modules/minimist": { 235 | "version": "1.2.6", 236 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", 237 | "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" 238 | }, 239 | "node_modules/prompts": { 240 | "version": "2.4.2", 241 | "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", 242 | "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", 243 | "dependencies": { 244 | "kleur": "^3.0.3", 245 | "sisteransi": "^1.0.5" 246 | }, 247 | "engines": { 248 | "node": ">= 6" 249 | } 250 | }, 251 | "node_modules/sisteransi": { 252 | "version": "1.0.5", 253 | "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", 254 | "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" 255 | }, 256 | "node_modules/supports-color": { 257 | "version": "7.2.0", 258 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 259 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 260 | "dependencies": { 261 | "has-flag": "^4.0.0" 262 | }, 263 | "engines": { 264 | "node": ">=8" 265 | } 266 | }, 267 | "node_modules/ts-node": { 268 | "version": "10.8.1", 269 | "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.8.1.tgz", 270 | "integrity": "sha512-Wwsnao4DQoJsN034wePSg5nZiw4YKXf56mPIAeD6wVmiv+RytNSWqc2f3fKvcUoV+Yn2+yocD71VOfQHbmVX4g==", 271 | "dev": true, 272 | "dependencies": { 273 | "@cspotcode/source-map-support": "^0.8.0", 274 | "@tsconfig/node10": "^1.0.7", 275 | "@tsconfig/node12": "^1.0.7", 276 | "@tsconfig/node14": "^1.0.0", 277 | "@tsconfig/node16": "^1.0.2", 278 | "acorn": "^8.4.1", 279 | "acorn-walk": "^8.1.1", 280 | "arg": "^4.1.0", 281 | "create-require": "^1.1.0", 282 | "diff": "^4.0.1", 283 | "make-error": "^1.1.1", 284 | "v8-compile-cache-lib": "^3.0.1", 285 | "yn": "3.1.1" 286 | }, 287 | "bin": { 288 | "ts-node": "dist/bin.js", 289 | "ts-node-cwd": "dist/bin-cwd.js", 290 | "ts-node-esm": "dist/bin-esm.js", 291 | "ts-node-script": "dist/bin-script.js", 292 | "ts-node-transpile-only": "dist/bin-transpile.js", 293 | "ts-script": "dist/bin-script-deprecated.js" 294 | }, 295 | "peerDependencies": { 296 | "@swc/core": ">=1.2.50", 297 | "@swc/wasm": ">=1.2.50", 298 | "@types/node": "*", 299 | "typescript": ">=2.7" 300 | }, 301 | "peerDependenciesMeta": { 302 | "@swc/core": { 303 | "optional": true 304 | }, 305 | "@swc/wasm": { 306 | "optional": true 307 | } 308 | } 309 | }, 310 | "node_modules/typescript": { 311 | "version": "4.7.4", 312 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", 313 | "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", 314 | "dev": true, 315 | "bin": { 316 | "tsc": "bin/tsc", 317 | "tsserver": "bin/tsserver" 318 | }, 319 | "engines": { 320 | "node": ">=4.2.0" 321 | } 322 | }, 323 | "node_modules/v8-compile-cache-lib": { 324 | "version": "3.0.1", 325 | "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", 326 | "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", 327 | "dev": true 328 | }, 329 | "node_modules/yn": { 330 | "version": "3.1.1", 331 | "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", 332 | "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", 333 | "dev": true, 334 | "engines": { 335 | "node": ">=6" 336 | } 337 | } 338 | }, 339 | "dependencies": { 340 | "@cspotcode/source-map-support": { 341 | "version": "0.8.1", 342 | "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", 343 | "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", 344 | "dev": true, 345 | "requires": { 346 | "@jridgewell/trace-mapping": "0.3.9" 347 | } 348 | }, 349 | "@jridgewell/resolve-uri": { 350 | "version": "3.0.7", 351 | "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", 352 | "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", 353 | "dev": true 354 | }, 355 | "@jridgewell/sourcemap-codec": { 356 | "version": "1.4.13", 357 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", 358 | "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", 359 | "dev": true 360 | }, 361 | "@jridgewell/trace-mapping": { 362 | "version": "0.3.9", 363 | "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", 364 | "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", 365 | "dev": true, 366 | "requires": { 367 | "@jridgewell/resolve-uri": "^3.0.3", 368 | "@jridgewell/sourcemap-codec": "^1.4.10" 369 | } 370 | }, 371 | "@tsconfig/node10": { 372 | "version": "1.0.9", 373 | "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", 374 | "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", 375 | "dev": true 376 | }, 377 | "@tsconfig/node12": { 378 | "version": "1.0.11", 379 | "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", 380 | "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", 381 | "dev": true 382 | }, 383 | "@tsconfig/node14": { 384 | "version": "1.0.3", 385 | "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", 386 | "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", 387 | "dev": true 388 | }, 389 | "@tsconfig/node16": { 390 | "version": "1.0.3", 391 | "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", 392 | "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", 393 | "dev": true 394 | }, 395 | "@types/minimist": { 396 | "version": "1.2.2", 397 | "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", 398 | "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", 399 | "dev": true 400 | }, 401 | "@types/node": { 402 | "version": "18.0.0", 403 | "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.0.tgz", 404 | "integrity": "sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==", 405 | "dev": true 406 | }, 407 | "@types/prompts": { 408 | "version": "2.0.14", 409 | "resolved": "https://registry.npmjs.org/@types/prompts/-/prompts-2.0.14.tgz", 410 | "integrity": "sha512-HZBd99fKxRWpYCErtm2/yxUZv6/PBI9J7N4TNFffl5JbrYMHBwF25DjQGTW3b3jmXq+9P6/8fCIb2ee57BFfYA==", 411 | "dev": true, 412 | "requires": { 413 | "@types/node": "*" 414 | } 415 | }, 416 | "acorn": { 417 | "version": "8.7.1", 418 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", 419 | "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", 420 | "dev": true 421 | }, 422 | "acorn-walk": { 423 | "version": "8.2.0", 424 | "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", 425 | "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", 426 | "dev": true 427 | }, 428 | "ansi-styles": { 429 | "version": "4.3.0", 430 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 431 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 432 | "requires": { 433 | "color-convert": "^2.0.1" 434 | } 435 | }, 436 | "arg": { 437 | "version": "4.1.3", 438 | "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", 439 | "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", 440 | "dev": true 441 | }, 442 | "chalk": { 443 | "version": "4.1.2", 444 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 445 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 446 | "requires": { 447 | "ansi-styles": "^4.1.0", 448 | "supports-color": "^7.1.0" 449 | } 450 | }, 451 | "color-convert": { 452 | "version": "2.0.1", 453 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 454 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 455 | "requires": { 456 | "color-name": "~1.1.4" 457 | } 458 | }, 459 | "color-name": { 460 | "version": "1.1.4", 461 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 462 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" 463 | }, 464 | "create-require": { 465 | "version": "1.1.1", 466 | "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", 467 | "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", 468 | "dev": true 469 | }, 470 | "diff": { 471 | "version": "4.0.2", 472 | "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", 473 | "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", 474 | "dev": true 475 | }, 476 | "has-flag": { 477 | "version": "4.0.0", 478 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 479 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" 480 | }, 481 | "kleur": { 482 | "version": "3.0.3", 483 | "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", 484 | "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==" 485 | }, 486 | "locreq": { 487 | "version": "2.1.0", 488 | "resolved": "https://registry.npmjs.org/locreq/-/locreq-2.1.0.tgz", 489 | "integrity": "sha512-dB5vXhfq+imVNmAEAxKldmyxtTorplZVudgewOXjhEJpgk9aJ0G2YxRU8FHwnibADnyiLwo6kzrQrc/LD1kcWQ==", 490 | "requires": { 491 | "@types/node": "^14.14.16" 492 | }, 493 | "dependencies": { 494 | "@types/node": { 495 | "version": "14.18.63", 496 | "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", 497 | "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==" 498 | } 499 | } 500 | }, 501 | "make-error": { 502 | "version": "1.3.6", 503 | "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", 504 | "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", 505 | "dev": true 506 | }, 507 | "minimist": { 508 | "version": "1.2.6", 509 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", 510 | "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" 511 | }, 512 | "prompts": { 513 | "version": "2.4.2", 514 | "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", 515 | "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", 516 | "requires": { 517 | "kleur": "^3.0.3", 518 | "sisteransi": "^1.0.5" 519 | } 520 | }, 521 | "sisteransi": { 522 | "version": "1.0.5", 523 | "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", 524 | "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" 525 | }, 526 | "supports-color": { 527 | "version": "7.2.0", 528 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 529 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 530 | "requires": { 531 | "has-flag": "^4.0.0" 532 | } 533 | }, 534 | "ts-node": { 535 | "version": "10.8.1", 536 | "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.8.1.tgz", 537 | "integrity": "sha512-Wwsnao4DQoJsN034wePSg5nZiw4YKXf56mPIAeD6wVmiv+RytNSWqc2f3fKvcUoV+Yn2+yocD71VOfQHbmVX4g==", 538 | "dev": true, 539 | "requires": { 540 | "@cspotcode/source-map-support": "^0.8.0", 541 | "@tsconfig/node10": "^1.0.7", 542 | "@tsconfig/node12": "^1.0.7", 543 | "@tsconfig/node14": "^1.0.0", 544 | "@tsconfig/node16": "^1.0.2", 545 | "acorn": "^8.4.1", 546 | "acorn-walk": "^8.1.1", 547 | "arg": "^4.1.0", 548 | "create-require": "^1.1.0", 549 | "diff": "^4.0.1", 550 | "make-error": "^1.1.1", 551 | "v8-compile-cache-lib": "^3.0.1", 552 | "yn": "3.1.1" 553 | } 554 | }, 555 | "typescript": { 556 | "version": "4.7.4", 557 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", 558 | "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", 559 | "dev": true 560 | }, 561 | "v8-compile-cache-lib": { 562 | "version": "3.0.1", 563 | "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", 564 | "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", 565 | "dev": true 566 | }, 567 | "yn": { 568 | "version": "3.1.1", 569 | "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", 570 | "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", 571 | "dev": true 572 | } 573 | } 574 | } 575 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-managed-component", 3 | "version": "1.3.6", 4 | "description": "An easy way to create a Managed Component", 5 | "main": "index.ts", 6 | "bin": { 7 | "create-mc": "dist/index.js" 8 | }, 9 | "scripts": { 10 | "test": "tsc --noEmit", 11 | "build": "tsc" 12 | }, 13 | "engines": { 14 | "node": ">18.0.0" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "git+https://github.com/managed-components/create-mc.git" 19 | }, 20 | "keywords": [ 21 | "managed-components" 22 | ], 23 | "author": "", 24 | "license": "Apache-2.0", 25 | "bugs": { 26 | "url": "https://github.com/managed-components/create-mc/issues" 27 | }, 28 | "homepage": "https://github.com/managed-components/create-mc#readme", 29 | "devDependencies": { 30 | "@types/minimist": "^1.2.2", 31 | "@types/prompts": "^2.0.14", 32 | "ts-node": "^10.8.1", 33 | "typescript": "^4.7.4" 34 | }, 35 | "dependencies": { 36 | "chalk": "^4.1.2", 37 | "locreq": "^2.1.0", 38 | "minimist": "^1.2.6", 39 | "prompts": "^2.4.2" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import chalk from 'chalk' 3 | import minimist from 'minimist' 4 | import prompts from 'prompts' 5 | import renderTemplate from './renderTemplate' 6 | ;(async function () { 7 | const isValidPackageName = (projectName: string) => 8 | /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test( 9 | projectName 10 | ) 11 | 12 | const toValidPackageName = (projectName: string) => 13 | projectName 14 | .trim() 15 | .toLowerCase() 16 | .replace(/\s+/g, '-') 17 | .replace(/^[._]/, '') 18 | .replace(/[^a-z0-9-~]+/g, '-') 19 | 20 | interface InitConfig { 21 | displayName: string 22 | namespace: string 23 | description: string 24 | icon: string 25 | implements: string[] 26 | permissions: string[] 27 | } 28 | 29 | let initConfig: Partial = {} 30 | 31 | let permissionDetails: Record = {} 32 | let confirmed: { value?: boolean } = {} 33 | let cleanParams: any = {} 34 | 35 | const argv = minimist(process.argv.slice(2), {}) 36 | let targetDir = argv._[0] 37 | 38 | const implementsChoices = [ 39 | { 40 | title: 'E-commerce events', 41 | value: 'ecommerce_events', 42 | description: 'required to enable handling of e-commerce data', 43 | }, 44 | { 45 | title: 'Manager events', 46 | value: 'manager_events', 47 | description: 'required for pageview and/or clientcreated event handling', 48 | }, 49 | { 50 | title: 'Client Events', 51 | value: 'client_events', 52 | description: 'e.g. mousedown, resize, scroll etc.', 53 | }, 54 | { 55 | title: 'User events', 56 | value: 'user_events', 57 | description: 'required to enable handling of user-defined events', 58 | }, 59 | { 60 | title: 'Widgets', 61 | value: 'widget', 62 | description: 'required to enable rendering widgets', 63 | }, 64 | { 65 | title: 'Embeds', 66 | value: 'embed', 67 | description: 'required to enable rendering embeds', 68 | }, 69 | ] 70 | 71 | const permissionChoices = [ 72 | { 73 | title: 'Access Client KV', 74 | value: 'access_client_kv', 75 | description: 'required for: client.get, client.set', 76 | }, 77 | { 78 | title: 'Access Extended Client KV', 79 | value: 'access_extended_client_kv', 80 | description: 81 | 'required for: client.get when getting a key from another tool', 82 | }, 83 | { 84 | title: 'Execute Unsafe Scripts', 85 | value: 'execute_unsafe_scripts', 86 | description: 'required for: client.execute', 87 | }, 88 | { 89 | title: 'Client Network Requests', 90 | value: 'client_network_requests', 91 | description: 'required for: client.fetch', 92 | }, 93 | { 94 | title: 'Server Network Requests', 95 | value: 'server_network_requests', 96 | description: 'required for: manager.fetch', 97 | }, 98 | { 99 | title: 'Serve Static Files', 100 | value: 'serve_static_files', 101 | description: 'required for: serve', 102 | }, 103 | { 104 | title: 'Provide Server Functionality', 105 | value: 'provide_server_functionality', 106 | description: 'required for: proxy, route', 107 | }, 108 | { 109 | title: 'Provide Widget', 110 | value: 'provide_widget', 111 | description: 'required for: provideWidget', 112 | }, 113 | ] 114 | 115 | const getPermissionPrompts = (selected: string[]) => { 116 | return permissionChoices 117 | .filter(({ value }) => selected.includes(value)) 118 | .flatMap(({ title, value }, index) => { 119 | return [ 120 | { 121 | type: 'text', 122 | name: `${value}_description`, 123 | message: `Permission #${index + 1} of ${ 124 | selected.length 125 | } (${title}) description:`, 126 | initial: 127 | 'This permission is used to facilitate better a user experience.', 128 | }, 129 | { 130 | type: 'toggle', 131 | name: `${value}_required`, 132 | message: `Permission #${index + 1} of ${ 133 | selected.length 134 | } (${title}) required?`, 135 | active: 'true', 136 | inactive: 'false', 137 | initial: true, 138 | }, 139 | ] 140 | }) 141 | } 142 | 143 | const getCleanParams = ( 144 | initConfig: InitConfig, 145 | permissionDetails: Record 146 | ) => { 147 | const permissions: any = {} 148 | if (initConfig.permissions) { 149 | initConfig.permissions.forEach((perm) => { 150 | permissions[perm] = { 151 | description: permissionDetails[`${perm}_description`], 152 | required: permissionDetails[`${perm}_required`], 153 | } 154 | }) 155 | } 156 | return { ...initConfig, permissions } 157 | } 158 | 159 | try { 160 | initConfig = await prompts( 161 | [ 162 | { 163 | name: 'displayName', 164 | type: 'text', 165 | message: 'Display name:', 166 | initial: 'MC Dynamite', 167 | onState: (state) => 168 | (targetDir = String(state.value).trim() || 'MC Dynamite'), 169 | }, 170 | { 171 | name: 'namespace', 172 | type: 'text', 173 | message: 'Namespace:', 174 | initial: () => toValidPackageName(targetDir), 175 | validate: (dir) => 176 | isValidPackageName(dir) || 'Invalid package.json name', 177 | }, 178 | { 179 | name: 'description', 180 | type: 'text', 181 | message: 'Description:', 182 | initial: 'A Managed Component for making the internet better', 183 | }, 184 | { 185 | name: 'icon', 186 | type: 'text', 187 | message: 'Path to svg icon:', 188 | initial: 'assets/icon.svg', 189 | }, 190 | // TBC - will re-enable when respected by webCM 191 | // { 192 | // name: 'implements', 193 | // type: 'multiselect', 194 | // message: 'Required Implementations:', 195 | // instructions: false, 196 | // choices: implementsChoices, 197 | // min: 1, 198 | // }, 199 | { 200 | name: 'permissions', 201 | type: 'multiselect', 202 | message: 'Requested Permissions:', 203 | instructions: false, 204 | choices: permissionChoices, 205 | }, 206 | ], 207 | { 208 | onCancel: () => { 209 | throw new Error(chalk.red('✖') + ' Operation cancelled') 210 | }, 211 | } 212 | ) 213 | if (initConfig.permissions) { 214 | permissionDetails = await prompts( 215 | getPermissionPrompts(initConfig.permissions) as any, 216 | { 217 | onCancel: () => { 218 | throw new Error(chalk.red('✖') + ' Operation cancelled') 219 | }, 220 | } 221 | ) 222 | } 223 | cleanParams = getCleanParams( 224 | initConfig as Required, 225 | permissionDetails 226 | ) 227 | confirmed = await prompts({ 228 | type: 'confirm', 229 | name: 'value', 230 | message: `Confirm new managed component?: ${chalk.yellow( 231 | JSON.stringify(cleanParams, null, 2) 232 | )}`, 233 | initial: false, 234 | }) 235 | } catch (cancelled: any) { 236 | console.log(cancelled.message) 237 | process.exit(1) 238 | } 239 | if (confirmed.value) { 240 | renderTemplate(cleanParams) 241 | console.log( 242 | chalk.greenBright.bold( 243 | `\n\n✅ ${cleanParams.displayName} Managed Component project initialised!\n Now run: cd ${cleanParams.namespace} and start development in your src/index.ts file\n\n` 244 | ) 245 | ) 246 | console.log( 247 | chalk.yellow( 248 | '💡 Remember to update the README.md file with a populated Fields Description section and Tool Settings including all the information a Component Manager would need to run the component.\nSee https://managedcomponents.dev/components for inspiration.' 249 | ) + '\n' 250 | ) 251 | } 252 | })() 253 | 254 | export {} 255 | -------------------------------------------------------------------------------- /src/renderTemplate.ts: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import fs from 'fs' 3 | import _locreq from 'locreq' 4 | const locreq = _locreq(__dirname) 5 | 6 | type Permission = 7 | | 'access_client_kv' 8 | | 'access_extended_client_kv' 9 | | 'execute_unsafe_scripts' 10 | | 'client_network_requests' 11 | | 'serve_static_files' 12 | | 'provide_server_functionality' 13 | | 'provide_widget' 14 | | 'server_network_requests' 15 | 16 | interface Config { 17 | displayName: string 18 | namespace: string 19 | description: string 20 | icon: string 21 | implements: string[] 22 | permissions: { 23 | [Key in Permission]: { 24 | description: string 25 | required: boolean 26 | } 27 | } 28 | } 29 | 30 | export default function initTemplate(config: Config) { 31 | const { 32 | displayName, 33 | namespace, 34 | description, 35 | icon, 36 | implements: imps, 37 | permissions, 38 | } = config 39 | if (!fs.existsSync(namespace)) { 40 | fs.mkdirSync(namespace) 41 | } 42 | const manifest = { 43 | name: displayName, 44 | namespace, 45 | description, 46 | icon, 47 | implements: imps, 48 | permissions, 49 | } 50 | fs.writeFileSync( 51 | `${namespace}/manifest.json`, 52 | JSON.stringify(manifest, null, 2), 53 | ) 54 | fs.writeFileSync(`${namespace}/.npmignore`, 'src') 55 | processDir(config) 56 | } 57 | 58 | function processDir(config: Config, subdir = '.') { 59 | const { displayName, namespace, description, implements: imps } = config 60 | const templateDir = path.resolve(locreq.resolve('template'), subdir) 61 | const targetDir = path.resolve(namespace, subdir) 62 | if (!fs.existsSync(targetDir)) { 63 | fs.mkdirSync(targetDir, { recursive: true }) 64 | } 65 | 66 | const files = fs.readdirSync(templateDir) 67 | for (const file of files) { 68 | const src = path.resolve(templateDir, file) 69 | const dest = path.resolve(targetDir, file).replace(/\.keep$/, '') // we suffix .npmignore file with `.keep` in order to prevent template files it mentions being not published to npm 70 | if (fs.lstatSync(src).isDirectory()) { 71 | processDir(config, subdir + '/' + path.basename(src)) 72 | } else { 73 | const data = fs.readFileSync(src, 'utf8') 74 | const replaced = data.replace(/{{ displayName }}/g, displayName as string) 75 | const replaced2 = replaced.replace( 76 | /{{ namespace }}/g, 77 | namespace as string, 78 | ) 79 | const replaced3 = replaced2.replace( 80 | /{{ description }}/g, 81 | description as string, 82 | ) 83 | fs.writeFileSync(dest, replaced3) 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /template/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', 3 | extends: [ 4 | 'eslint:recommended', 5 | 'plugin:@typescript-eslint/recommended', 6 | 'plugin:prettier/recommended', 7 | ], 8 | plugins: ['prettier'], 9 | env: { 10 | node: true, 11 | browser: true, 12 | worker: true, 13 | es2022: true, 14 | }, 15 | rules: { 16 | 'prettier/prettier': 'error', 17 | 'no-unused-vars': 'off', 18 | '@typescript-eslint/no-unused-vars': [ 19 | 'error', 20 | { ignoreRestSiblings: true, argsIgnorePattern: '^_' }, 21 | ], 22 | }, 23 | overrides: [ 24 | { 25 | files: ['*d.ts'], 26 | rules: { 27 | 'no-undef': 'off', 28 | }, 29 | }, 30 | { 31 | files: ['*js'], 32 | globals: { 33 | webcm: 'writable', 34 | }, 35 | }, 36 | ], 37 | } 38 | -------------------------------------------------------------------------------- /template/.github/workflows/node.js.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs 3 | 4 | name: Node.js CI 5 | 6 | on: 7 | push: 8 | branches: [ "main" ] 9 | pull_request: 10 | branches: [ "main" ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | strategy: 18 | matrix: 19 | node-version: [20.0] 20 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ 21 | 22 | steps: 23 | - uses: actions/checkout@v3 24 | - name: Use Node.js ${{ matrix.node-version }} 25 | uses: actions/setup-node@v3 26 | with: 27 | node-version: ${{ matrix.node-version }} 28 | cache: 'npm' 29 | - run: npm ci 30 | - run: npm run build --if-present 31 | - run: npm test 32 | -------------------------------------------------------------------------------- /template/.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: 'Build Test' 2 | 3 | on: 4 | push: 5 | branches: 6 | - '**' 7 | 8 | jobs: 9 | build-test: 10 | runs-on: ubuntu-latest 11 | strategy: 12 | matrix: 13 | node-version: [18.x] 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Running Node.js ${{ matrix.node-version }} 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: ${{ matrix.node-version }} 20 | # Actual Tests 21 | - run: npm i 22 | - run: npm run lint --if-present 23 | - run: npm run typecheck --if-present 24 | - run: npm run bundle --if-present 25 | - run: npm run test --if-present 26 | -------------------------------------------------------------------------------- /template/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.toptal.com/developers/gitignore/api/node 2 | # Edit at https://www.toptal.com/developers/gitignore?templates=node 3 | 4 | ### Node ### 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | lerna-debug.log* 12 | .pnpm-debug.log* 13 | 14 | # Diagnostic reports (https://nodejs.org/api/report.html) 15 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 16 | 17 | # Runtime data 18 | pids 19 | *.pid 20 | *.seed 21 | *.pid.lock 22 | 23 | # Directory for instrumented libs generated by jscoverage/JSCover 24 | lib-cov 25 | 26 | # Coverage directory used by tools like istanbul 27 | coverage 28 | *.lcov 29 | 30 | # nyc test coverage 31 | .nyc_output 32 | 33 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 34 | .grunt 35 | 36 | # Bower dependency directory (https://bower.io/) 37 | bower_components 38 | 39 | # node-waf configuration 40 | .lock-wscript 41 | 42 | # Compiled binary addons (https://nodejs.org/api/addons.html) 43 | build/Release 44 | 45 | # Dependency directories 46 | node_modules/ 47 | jspm_packages/ 48 | 49 | # Snowpack dependency directory (https://snowpack.dev/) 50 | web_modules/ 51 | 52 | # TypeScript cache 53 | *.tsbuildinfo 54 | 55 | # Optional npm cache directory 56 | .npm 57 | 58 | # Optional eslint cache 59 | .eslintcache 60 | 61 | # Optional stylelint cache 62 | .stylelintcache 63 | 64 | # Microbundle cache 65 | .rpt2_cache/ 66 | .rts2_cache_cjs/ 67 | .rts2_cache_es/ 68 | .rts2_cache_umd/ 69 | 70 | # Optional REPL history 71 | .node_repl_history 72 | 73 | # Output of 'npm pack' 74 | *.tgz 75 | 76 | # Yarn Integrity file 77 | .yarn-integrity 78 | 79 | # dotenv environment variable files 80 | .env 81 | .env.development.local 82 | .env.test.local 83 | .env.production.local 84 | .env.local 85 | 86 | # parcel-bundler cache (https://parceljs.org/) 87 | .cache 88 | .parcel-cache 89 | 90 | # Next.js build output 91 | .next 92 | out 93 | 94 | # Nuxt.js build / generate output 95 | .nuxt 96 | dist 97 | 98 | # Gatsby files 99 | .cache/ 100 | # Comment in the public line in if your project uses Gatsby and not Next.js 101 | # https://nextjs.org/blog/next-9-1#public-directory-support 102 | # public 103 | 104 | # vuepress build output 105 | .vuepress/dist 106 | 107 | # vuepress v2.x temp and cache directory 108 | .temp 109 | 110 | # Docusaurus cache and generated files 111 | .docusaurus 112 | 113 | # Serverless directories 114 | .serverless/ 115 | 116 | # FuseBox cache 117 | .fusebox/ 118 | 119 | # DynamoDB Local files 120 | .dynamodb/ 121 | 122 | # TernJS port file 123 | .tern-port 124 | 125 | # Stores VSCode versions used for testing VSCode extensions 126 | .vscode-test 127 | 128 | # yarn v2 129 | .yarn/cache 130 | .yarn/unplugged 131 | .yarn/build-state.yml 132 | .yarn/install-state.gz 133 | .pnp.* 134 | 135 | ### Node Patch ### 136 | # Serverless Webpack directories 137 | .webpack/ 138 | 139 | # Optional stylelint cache 140 | 141 | # SvelteKit build / generate output 142 | .svelte-kit 143 | 144 | # End of https://www.toptal.com/developers/gitignore/api/node 145 | 146 | .vscode 147 | -------------------------------------------------------------------------------- /template/.npmignore.keep: -------------------------------------------------------------------------------- 1 | .all-contributorsrc 2 | .eslintrc.js 3 | .github 4 | .prettierrc 5 | esbuild.js 6 | tsconfig.build.json 7 | tsconfig.json 8 | coverage 9 | -------------------------------------------------------------------------------- /template/.nvmrc: -------------------------------------------------------------------------------- 1 | 20 -------------------------------------------------------------------------------- /template/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "semi": false, 4 | "trailingComma": "es5", 5 | "tabWidth": 2, 6 | "printWidth": 80, 7 | "arrowParens": "avoid" 8 | } 9 | -------------------------------------------------------------------------------- /template/LICENSE: -------------------------------------------------------------------------------- 1 | Licensed under the Apache License, Version 2.0 (the "License"); 2 | you may not use this file except in compliance with the License. 3 | You may obtain a copy of the License at 4 | 5 | http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. -------------------------------------------------------------------------------- /template/README.md: -------------------------------------------------------------------------------- 1 | # {{ displayName }} Managed Component 2 | 3 | ## Documentation 4 | 5 | Managed Components docs are published at **https://managedcomponents.dev** . 6 | 7 | Find out more about Managed Components [here](https://blog.cloudflare.com/zaraz-open-source-managed-components-and-webcm/) for inspiration and motivation details. 8 | 9 | [![Released under the Apache license.](https://img.shields.io/badge/license-apache-blue.svg)](./LICENSE) 10 | [![PRs welcome!](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](./CONTRIBUTING.md) 11 | [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) 12 | 13 | ## 🚀 Quickstart local dev environment 14 | 15 | 1. Make sure you're running node version >=18. 16 | 2. Install dependencies with `npm i` 17 | 3. Run unit test watcher with `npm run test:dev` 18 | 19 | ## ⚙️ Tool Settings 20 | 21 | > Settings are used to configure the tool in a Component Manager config file 22 | 23 | ### Example Setting `boolean` 24 | 25 | `exampleSetting` can be the pixelID or any other essential/optional setting like the option to anonymize IPs, send ecommerce events etc. 26 | 27 | ## 🧱 Fields Description 28 | 29 | > Fields are properties that can/must be sent with certain events 30 | 31 | ### Human Readable Field Name `type` _required_ 32 | 33 | `field_id` give it a short description and send to a more detailed reference [Find more about how to create your own Managed Component](https://managedcomponents.dev/). 34 | 35 | ## 📝 License 36 | 37 | Licensed under the [Apache License](./LICENSE). 38 | -------------------------------------------------------------------------------- /template/esbuild.js: -------------------------------------------------------------------------------- 1 | require('esbuild').buildSync({ 2 | entryPoints: ['src/index.ts'], 3 | bundle: true, 4 | minify: true, 5 | format: 'esm', 6 | platform: 'node', 7 | target: ['esnext'], 8 | tsconfig: 'tsconfig.build.json', 9 | outfile: 'dist/index.js', 10 | }) 11 | -------------------------------------------------------------------------------- /template/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{ namespace }}", 3 | "version": "1.0.0", 4 | "description": "{{ description }}", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "lint": "eslint --ext .ts,.js, src", 8 | "lint:fix": "eslint --ext .ts,.js, src --fix", 9 | "bundle": "node esbuild.js", 10 | "build": "npm run test && npm run lint && npm run typecheck && npm run bundle", 11 | "typecheck": "tsc --project tsconfig.build.json --noEmit", 12 | "test": "vitest run --globals", 13 | "test:dev": "vitest --globals" 14 | }, 15 | "keywords": [ 16 | "webcm", 17 | "managed-components", 18 | "{{ namespace }}" 19 | ], 20 | "author": "", 21 | "license": "Apache-2.0", 22 | "devDependencies": { 23 | "@managed-components/types": "^1.3.14", 24 | "@typescript-eslint/eslint-plugin": "^7.0.2", 25 | "esbuild": "^0.20.1", 26 | "eslint": "^8.57.0", 27 | "eslint-config-prettier": "^9.1.0", 28 | "eslint-plugin-prettier": "^5.1.3", 29 | "ts-node": "^10.9.2", 30 | "typescript": "^5.3.3", 31 | "vitest": "^1.3.1" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /template/src/index.test.ts: -------------------------------------------------------------------------------- 1 | import crypto from 'crypto' 2 | 3 | beforeAll(() => { 4 | vi.stubGlobal('crypto', crypto) 5 | }) 6 | 7 | describe('{{ namespace }}', () => { 8 | it('example test', () => { 9 | expect(true).toEqual(true) 10 | }) 11 | }) 12 | -------------------------------------------------------------------------------- /template/src/index.ts: -------------------------------------------------------------------------------- 1 | import { ComponentSettings, Manager } from '@managed-components/types' 2 | 3 | export default async function (manager: Manager, _settings: ComponentSettings) { 4 | manager.addEventListener('pageview', event => { 5 | console.log('Hello server!') 6 | event.client.execute("console.log('Hello browser')") 7 | }) 8 | } 9 | -------------------------------------------------------------------------------- /template/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "exclude": ["src/**/*.test.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /template/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, 4 | "module": "commonjs" /* Specify what module code is generated. */, 5 | "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, 6 | "types": [ 7 | "vitest/globals" 8 | ] /* Specify type package names to be included without being referenced in a source file. */, 9 | "resolveJsonModule": true /* Enable importing .json files */, 10 | "outDir": "./dist" /* Specify an output folder for all emitted files. */, 11 | "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */, 12 | "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, 13 | "strict": true /* Enable all strict type-checking options. */, 14 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /template/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config' 2 | 3 | export default defineConfig({}) 4 | 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "ESNext", 4 | "target": "ESnext", 5 | "module": "CommonJS", 6 | "moduleResolution": "Node", 7 | "strict": true, 8 | "lib": [], 9 | "types": ["node"], 10 | "allowSyntheticDefaultImports": true, 11 | "esModuleInterop": true, 12 | "outDir": "./dist" 13 | }, 14 | "include": ["src/**/*"], 15 | "exclude": ["./template/**/*"] 16 | } 17 | --------------------------------------------------------------------------------