From c243630d4f29a87ca772a82989ee5b85eebbfe0f Mon Sep 17 00:00:00 2001 From: Jason Santos Date: Thu, 28 Mar 2024 01:45:43 -0400 Subject: [PATCH] initial commit for the Token Synchronizer --- RadiusTokenSync/.eslintignore | 1 + RadiusTokenSync/.gitignore | 8 + RadiusTokenSync/README.md | 36 + RadiusTokenSync/manifest.json | 16 + RadiusTokenSync/package-lock.json | 2525 +++++++++++++++++ RadiusTokenSync/package.json | 57 + RadiusTokenSync/vite.config.ts | 30 + RadiusTokenSync/web-src/components/config.tsx | 27 + RadiusTokenSync/web-src/index.html | 15 + RadiusTokenSync/web-src/index.tsx | 14 + RadiusTokenSync/web-src/tsconfig.json | 78 + RadiusTokenSync/widget-src/code.tsx | 43 + .../widget-src/common/component.utils.ts | 100 + .../widget-src/common/figma.types.ts | 24 + .../widget-src/common/generator.utils.ts | 132 + .../widget-src/common/token-parser.types.ts | 212 ++ .../widget-src/common/token-parser.utils.ts | 130 + .../widget-src/common/token.types.ts | 24 + .../widget-src/common/token.utils.ts | 257 ++ .../widget-src/common/variables.utils.ts | 117 + .../widget-src/local-variable/index.tsx | 1 + .../local-variable/local-variable.tsx | 85 + .../widget-src/token-list/component-docs.tsx | 184 ++ .../widget-src/token-list/index.ts | 3 + .../widget-src/token-list/prop-docs.tsx | 144 + .../widget-src/token-list/variants-docs.tsx | 199 ++ .../widget-src/token-studio/index.tsx | 1 + .../widget-src/token-studio/token-studio.tsx | 31 + RadiusTokenSync/widget-src/tsconfig.json | 12 + RadiusTokenSync/widget-src/types.d.ts | 44 + .../widget-src/ui/components/bottom-logo.tsx | 119 + .../widget-src/ui/components/button.tsx | 41 + .../widget-src/ui/components/icon.tsx | 93 + .../widget-src/ui/components/name-format.tsx | 122 + .../widget-src/ui/components/pill.tsx | 24 + .../ui/components/widget-header.tsx | 93 + .../widget-src/ui/pages/empty-page.tsx | 39 + 37 files changed, 5081 insertions(+) create mode 100644 RadiusTokenSync/.eslintignore create mode 100644 RadiusTokenSync/.gitignore create mode 100644 RadiusTokenSync/README.md create mode 100644 RadiusTokenSync/manifest.json create mode 100644 RadiusTokenSync/package-lock.json create mode 100644 RadiusTokenSync/package.json create mode 100644 RadiusTokenSync/vite.config.ts create mode 100644 RadiusTokenSync/web-src/components/config.tsx create mode 100644 RadiusTokenSync/web-src/index.html create mode 100644 RadiusTokenSync/web-src/index.tsx create mode 100644 RadiusTokenSync/web-src/tsconfig.json create mode 100644 RadiusTokenSync/widget-src/code.tsx create mode 100644 RadiusTokenSync/widget-src/common/component.utils.ts create mode 100644 RadiusTokenSync/widget-src/common/figma.types.ts create mode 100644 RadiusTokenSync/widget-src/common/generator.utils.ts create mode 100644 RadiusTokenSync/widget-src/common/token-parser.types.ts create mode 100644 RadiusTokenSync/widget-src/common/token-parser.utils.ts create mode 100644 RadiusTokenSync/widget-src/common/token.types.ts create mode 100644 RadiusTokenSync/widget-src/common/token.utils.ts create mode 100644 RadiusTokenSync/widget-src/common/variables.utils.ts create mode 100644 RadiusTokenSync/widget-src/local-variable/index.tsx create mode 100644 RadiusTokenSync/widget-src/local-variable/local-variable.tsx create mode 100644 RadiusTokenSync/widget-src/token-list/component-docs.tsx create mode 100644 RadiusTokenSync/widget-src/token-list/index.ts create mode 100644 RadiusTokenSync/widget-src/token-list/prop-docs.tsx create mode 100644 RadiusTokenSync/widget-src/token-list/variants-docs.tsx create mode 100644 RadiusTokenSync/widget-src/token-studio/index.tsx create mode 100644 RadiusTokenSync/widget-src/token-studio/token-studio.tsx create mode 100644 RadiusTokenSync/widget-src/tsconfig.json create mode 100644 RadiusTokenSync/widget-src/types.d.ts create mode 100644 RadiusTokenSync/widget-src/ui/components/bottom-logo.tsx create mode 100644 RadiusTokenSync/widget-src/ui/components/button.tsx create mode 100644 RadiusTokenSync/widget-src/ui/components/icon.tsx create mode 100644 RadiusTokenSync/widget-src/ui/components/name-format.tsx create mode 100644 RadiusTokenSync/widget-src/ui/components/pill.tsx create mode 100644 RadiusTokenSync/widget-src/ui/components/widget-header.tsx create mode 100644 RadiusTokenSync/widget-src/ui/pages/empty-page.tsx diff --git a/RadiusTokenSync/.eslintignore b/RadiusTokenSync/.eslintignore new file mode 100644 index 0000000..e15fb82 --- /dev/null +++ b/RadiusTokenSync/.eslintignore @@ -0,0 +1 @@ +**/.eslintrc.js diff --git a/RadiusTokenSync/.gitignore b/RadiusTokenSync/.gitignore new file mode 100644 index 0000000..f16fba9 --- /dev/null +++ b/RadiusTokenSync/.gitignore @@ -0,0 +1,8 @@ +# Node +*.log +*.log.* +node_modules + +out/ +dist/ +code.js diff --git a/RadiusTokenSync/README.md b/RadiusTokenSync/README.md new file mode 100644 index 0000000..a8343e9 --- /dev/null +++ b/RadiusTokenSync/README.md @@ -0,0 +1,36 @@ +Below are the steps to get your widget running. You can also find instructions at: + +https://www.figma.com/widget-docs/setup-guide/ + +This widget template uses TypeScript and NPM, two standard tools in creating JavaScript applications. + +First, download Node.js which comes with NPM. This will allow you to install TypeScript and other +libraries. You can find the download link here: + +https://nodejs.org/en/download/ + +Next, install TypeScript, esbuild and the latest type definitions by running: + +npm install + +If you are familiar with JavaScript, TypeScript will look very familiar. In fact, valid JavaScript code +is already valid Typescript code. + +TypeScript adds type annotations to variables. This allows code editors such as Visual Studio Code +to provide information about the Figma API while you are writing code, as well as help catch bugs +you previously didn't notice. + +For more information, visit https://www.typescriptlang.org/ + +Using TypeScript requires a compiler to convert TypeScript (widget-src/code.tsx) into JavaScript (dist/code.js) +for the browser to run. We use esbuild to do this for us. + +We recommend writing TypeScript code using Visual Studio code: + +1. Download Visual Studio Code if you haven't already: https://code.visualstudio.com/. +2. Open this directory in Visual Studio Code. +3. Compile TypeScript to JavaScript: Run the "Terminal > Run Build Task..." menu item, + then select "npm: watch". You will have to do this again every time + you reopen Visual Studio Code. + +That's it! Visual Studio Code will regenerate the JavaScript file every time you save. diff --git a/RadiusTokenSync/manifest.json b/RadiusTokenSync/manifest.json new file mode 100644 index 0000000..9466969 --- /dev/null +++ b/RadiusTokenSync/manifest.json @@ -0,0 +1,16 @@ +{ + "name": "Radius Token Synchronizer", + "id": "000", + "api": "1.0.0", + "main": "dist/code.js", + "ui": "./dist/index.html", + "capabilities": [], + "enableProposedApi": false, + "editorType": ["figma"], + "containsWidget": true, + "widgetApi": "1.0.0", + "networkAccess": { + "allowedDomains": ["https://github.com"] + }, + "documentAccess": "dynamic-page" +} diff --git a/RadiusTokenSync/package-lock.json b/RadiusTokenSync/package-lock.json new file mode 100644 index 0000000..809d2f5 --- /dev/null +++ b/RadiusTokenSync/package-lock.json @@ -0,0 +1,2525 @@ +{ + "name": "@rangle/radius-figma-sync", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@rangle/radius-figma-sync", + "version": "1.0.0", + "dependencies": { + "@create-figma-plugin/ui": "^3.1.0", + "preact": "^10.20.1" + }, + "devDependencies": { + "@figma/eslint-plugin-figma-plugins": "*", + "@figma/plugin-typings": "*", + "@figma/widget-typings": "*", + "@typescript-eslint/eslint-plugin": "^6.12.0", + "@typescript-eslint/parser": "^6.12.0", + "esbuild": "*", + "eslint": "^8.54.0", + "typescript": "^5.3.2", + "vite": "^5.2.6", + "vite-plugin-singlefile": "^2.0.1" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@create-figma-plugin/ui": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@create-figma-plugin/ui/-/ui-3.1.0.tgz", + "integrity": "sha512-V8q5HtypBTxE3i8migBw6XNrM7fCtsgBEQ0/nwZw5q0in7sDNNtwu9H7ghyN8WX1NMqIBeNBGMPvwBUrzWj9KQ==", + "dependencies": { + "@create-figma-plugin/utilities": "^3.1.0" + }, + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "preact": ">=10" + } + }, + "node_modules/@create-figma-plugin/utilities": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@create-figma-plugin/utilities/-/utilities-3.1.0.tgz", + "integrity": "sha512-Si4eETOK7LJOd2P4WQZ8Yjd/q3ujE4z0vjvJg8axg1olwBl/LwCZiCyDetua0dM0Hiu63/ifPUdAIsZbkfeoSg==", + "dependencies": { + "hex-rgb": "^5.0.0", + "natural-compare-lite": "1.4.0", + "rgb-hex": "^4.1.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.1.tgz", + "integrity": "sha512-m55cpeupQ2DbuRGQMMZDzbv9J9PgVelPjlcmM5kxHnrBdBx6REaEd7LamYV7Dm8N7rCyR/XwU6rVP8ploKtIkA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.1.tgz", + "integrity": "sha512-4j0+G27/2ZXGWR5okcJi7pQYhmkVgb4D7UKwxcqrjhvp5TKWx3cUjgB1CGj1mfdmJBQ9VnUGgUhign+FPF2Zgw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.1.tgz", + "integrity": "sha512-hCnXNF0HM6AjowP+Zou0ZJMWWa1VkD77BXe959zERgGJBBxB+sV+J9f/rcjeg2c5bsukD/n17RKWXGFCO5dD5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.1.tgz", + "integrity": "sha512-MSfZMBoAsnhpS+2yMFYIQUPs8Z19ajwfuaSZx+tSl09xrHZCjbeXXMsUF/0oq7ojxYEpsSo4c0SfjxOYXRbpaA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.1.tgz", + "integrity": "sha512-Ylk6rzgMD8klUklGPzS414UQLa5NPXZD5tf8JmQU8GQrj6BrFA/Ic9tb2zRe1kOZyCbGl+e8VMbDRazCEBqPvA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.1.tgz", + "integrity": "sha512-pFIfj7U2w5sMp52wTY1XVOdoxw+GDwy9FsK3OFz4BpMAjvZVs0dT1VXs8aQm22nhwoIWUmIRaE+4xow8xfIDZA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.1.tgz", + "integrity": "sha512-UyW1WZvHDuM4xDz0jWun4qtQFauNdXjXOtIy7SYdf7pbxSWWVlqhnR/T2TpX6LX5NI62spt0a3ldIIEkPM6RHw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.1.tgz", + "integrity": "sha512-itPwCw5C+Jh/c624vcDd9kRCCZVpzpQn8dtwoYIt2TJF3S9xJLiRohnnNrKwREvcZYx0n8sCSbvGH349XkcQeg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.1.tgz", + "integrity": "sha512-LojC28v3+IhIbfQ+Vu4Ut5n3wKcgTu6POKIHN9Wpt0HnfgUGlBuyDDQR4jWZUZFyYLiz4RBBBmfU6sNfn6RhLw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.1.tgz", + "integrity": "sha512-cX8WdlF6Cnvw/DO9/X7XLH2J6CkBnz7Twjpk56cshk9sjYVcuh4sXQBy5bmTwzBjNVZze2yaV1vtcJS04LbN8w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.1.tgz", + "integrity": "sha512-4H/sQCy1mnnGkUt/xszaLlYJVTz3W9ep52xEefGtd6yXDQbz/5fZE5dFLUgsPdbUOQANcVUa5iO6g3nyy5BJiw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.1.tgz", + "integrity": "sha512-c0jgtB+sRHCciVXlyjDcWb2FUuzlGVRwGXgI+3WqKOIuoo8AmZAddzeOHeYLtD+dmtHw3B4Xo9wAUdjlfW5yYA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.1.tgz", + "integrity": "sha512-TgFyCfIxSujyuqdZKDZ3yTwWiGv+KnlOeXXitCQ+trDODJ+ZtGOzLkSWngynP0HZnTsDyBbPy7GWVXWaEl6lhA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.1.tgz", + "integrity": "sha512-b+yuD1IUeL+Y93PmFZDZFIElwbmFfIKLKlYI8M6tRyzE6u7oEP7onGk0vZRh8wfVGC2dZoy0EqX1V8qok4qHaw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.1.tgz", + "integrity": "sha512-wpDlpE0oRKZwX+GfomcALcouqjjV8MIX8DyTrxfyCfXxoKQSDm45CZr9fanJ4F6ckD4yDEPT98SrjvLwIqUCgg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.1.tgz", + "integrity": "sha512-5BepC2Au80EohQ2dBpyTquqGCES7++p7G+7lXe1bAIvMdXm4YYcEfZtQrP4gaoZ96Wv1Ute61CEHFU7h4FMueQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.1.tgz", + "integrity": "sha512-5gRPk7pKuaIB+tmH+yKd2aQTRpqlf1E4f/mC+tawIm/CGJemZcHZpp2ic8oD83nKgUPMEd0fNanrnFljiruuyA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.1.tgz", + "integrity": "sha512-4fL68JdrLV2nVW2AaWZBv3XEm3Ae3NZn/7qy2KGAt3dexAgSVT+Hc97JKSZnqezgMlv9x6KV0ZkZY7UO5cNLCg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.1.tgz", + "integrity": "sha512-GhRuXlvRE+twf2ES+8REbeCb/zeikNqwD3+6S5y5/x+DYbAQUNl0HNBs4RQJqrechS4v4MruEr8ZtAin/hK5iw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.1.tgz", + "integrity": "sha512-ZnWEyCM0G1Ex6JtsygvC3KUUrlDXqOihw8RicRuQAzw+c4f1D66YlPNNV3rkjVW90zXVsHwZYWbJh3v+oQFM9Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.1.tgz", + "integrity": "sha512-QZ6gXue0vVQY2Oon9WyLFCdSuYbXSoxaZrPuJ4c20j6ICedfsDilNPYfHLlMH7vGfU5DQR0czHLmJvH4Nzis/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.1.tgz", + "integrity": "sha512-HzcJa1NcSWTAU0MJIxOho8JftNp9YALui3o+Ny7hCh0v5f90nprly1U3Sj1Ldj/CvKKdvvFsCRvDkpsEMp4DNw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.1.tgz", + "integrity": "sha512-0MBh53o6XtI6ctDnRMeQ+xoCN8kD2qI1rY1KgF/xdWQwoFeKou7puvDfV8/Wv4Ctx2rRpET/gGdz3YlNtNACSA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@figma/eslint-plugin-figma-plugins": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@figma/eslint-plugin-figma-plugins/-/eslint-plugin-figma-plugins-0.14.0.tgz", + "integrity": "sha512-tkWXJACqX84t0vnxCO+298xw1AJByds/97Xgf26KR8bzGA21NoFM9CZOSLOggCnXZANJH6720qLxBYi/HVZMcA==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "^6.13.2", + "@typescript-eslint/utils": "^6.12.0", + "typescript": "^5.3.2" + } + }, + "node_modules/@figma/plugin-typings": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@figma/plugin-typings/-/plugin-typings-1.88.0.tgz", + "integrity": "sha512-ly9amJtPqlR48FZB0iKfyeCSo4O0QJhOfX+YYS/xEq0zoJzNETJLLQ43k93BS2W/N/BOVzgEjyAvC1WeuwFbdA==", + "dev": true + }, + "node_modules/@figma/widget-typings": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@figma/widget-typings/-/widget-typings-1.9.1.tgz", + "integrity": "sha512-jmh/hsBxLP4aKgtbmxkJe84Ufk93S7TwOxpLD7L58R472boU5vyZ7qF5DKlhwiRjF0sgaryXJxSXuIjdR1GBXQ==", + "dev": true, + "peerDependencies": { + "@figma/plugin-typings": "1.x" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.1.tgz", + "integrity": "sha512-4C4UERETjXpC4WpBXDbkgNVgHyWfG3B/NKY46e7w5H134UDOFqUJKpsLm0UYmuupW+aJmRgeScrDNfvZ5WV80A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.1.tgz", + "integrity": "sha512-TrTaFJ9pXgfXEiJKQ3yQRelpQFqgRzVR9it8DbeRzG0RX7mKUy0bqhCFsgevwXLJepQKTnLl95TnPGf9T9AMOA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.1.tgz", + "integrity": "sha512-fz7jN6ahTI3cKzDO2otQuybts5cyu0feymg0bjvYCBrZQ8tSgE8pc0sSNEuGvifrQJWiwx9F05BowihmLxeQKw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.1.tgz", + "integrity": "sha512-WTvdz7SLMlJpektdrnWRUN9C0N2qNHwNbWpNo0a3Tod3gb9leX+yrYdCeB7VV36OtoyiPAivl7/xZ3G1z5h20g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.1.tgz", + "integrity": "sha512-dBHQl+7wZzBYcIF6o4k2XkAfwP2ks1mYW2q/Gzv9n39uDcDiAGDqEyml08OdY0BIct0yLSPkDTqn4i6czpBLLw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.1.tgz", + "integrity": "sha512-bur4JOxvYxfrAmocRJIW0SADs3QdEYK6TQ7dTNz6Z4/lySeu3Z1H/+tl0a4qDYv0bCdBpUYM0sYa/X+9ZqgfSQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.1.tgz", + "integrity": "sha512-ssp77SjcDIUSoUyj7DU7/5iwM4ZEluY+N8umtCT9nBRs3u045t0KkW02LTyHouHDomnMXaXSZcCSr2bdMK63kA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.1.tgz", + "integrity": "sha512-Jv1DkIvwEPAb+v25/Unrnnq9BO3F5cbFPT821n3S5litkz+O5NuXuNhqtPx5KtcwOTtaqkTsO+IVzJOsxd11aQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.13.1.tgz", + "integrity": "sha512-U564BrhEfaNChdATQaEODtquCC7Ez+8Hxz1h5MAdMYj0AqD0GA9rHCpElajb/sQcaFL6NXmHc5O+7FXpWMa73Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.1.tgz", + "integrity": "sha512-zGRDulLTeDemR8DFYyFIQ8kMP02xpUsX4IBikc7lwL9PrwR3gWmX2NopqiGlI2ZVWMl15qZeUjumTwpv18N7sQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.1.tgz", + "integrity": "sha512-VTk/MveyPdMFkYJJPCkYBw07KcTkGU2hLEyqYMsU4NjiOfzoaDTW9PWGRsNwiOA3qI0k/JQPjkl/4FCK1smskQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.1.tgz", + "integrity": "sha512-L+hX8Dtibb02r/OYCsp4sQQIi3ldZkFI0EUkMTDwRfFykXBPptoz/tuuGqEd3bThBSLRWPR6wsixDSgOx/U3Zw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.1.tgz", + "integrity": "sha512-+dI2jVPfM5A8zme8riEoNC7UKk0Lzc7jCj/U89cQIrOjrZTCWZl/+IXUeRT2rEZ5j25lnSA9G9H1Ob9azaF/KQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.1.tgz", + "integrity": "sha512-YY1Exxo2viZ/O2dMHuwQvimJ0SqvL+OAWQLLY6rvXavgQKjhQUzn7nc1Dd29gjB5Fqi00nrBWctJBOyfVMIVxw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", + "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", + "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", + "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/esbuild": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.1.tgz", + "integrity": "sha512-OJwEgrpWm/PCMsLVWXKqvcjme3bHNpOgN7Tb6cQnR5n0TPbQx1/Xrn7rqM+wn17bYeT6MGB5sn1Bh5YiGi70nA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.20.1", + "@esbuild/android-arm": "0.20.1", + "@esbuild/android-arm64": "0.20.1", + "@esbuild/android-x64": "0.20.1", + "@esbuild/darwin-arm64": "0.20.1", + "@esbuild/darwin-x64": "0.20.1", + "@esbuild/freebsd-arm64": "0.20.1", + "@esbuild/freebsd-x64": "0.20.1", + "@esbuild/linux-arm": "0.20.1", + "@esbuild/linux-arm64": "0.20.1", + "@esbuild/linux-ia32": "0.20.1", + "@esbuild/linux-loong64": "0.20.1", + "@esbuild/linux-mips64el": "0.20.1", + "@esbuild/linux-ppc64": "0.20.1", + "@esbuild/linux-riscv64": "0.20.1", + "@esbuild/linux-s390x": "0.20.1", + "@esbuild/linux-x64": "0.20.1", + "@esbuild/netbsd-x64": "0.20.1", + "@esbuild/openbsd-x64": "0.20.1", + "@esbuild/sunos-x64": "0.20.1", + "@esbuild/win32-arm64": "0.20.1", + "@esbuild/win32-ia32": "0.20.1", + "@esbuild/win32-x64": "0.20.1" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hex-rgb": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/hex-rgb/-/hex-rgb-5.0.0.tgz", + "integrity": "sha512-NQO+lgVUCtHxZ792FodgW0zflK+ozS9X9dwGp9XvvmPlH7pyxd588cn24TD3rmPm/N0AIRXF10Otah8yKqGw4w==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==" + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/preact": { + "version": "10.20.1", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.20.1.tgz", + "integrity": "sha512-JIFjgFg9B2qnOoGiYMVBtrcFxHqn+dNXbq76bVmcaHYJFYR4lW67AOcXgAYQQTDYXDOg/kTZrKPNCdRgJ2UJmw==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rgb-hex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/rgb-hex/-/rgb-hex-4.1.0.tgz", + "integrity": "sha512-UZLM57BW09Yi9J1R3OP8B1yCbbDK3NT8BDtihGZkGkGEs2b6EaV85rsfJ6yK4F+8UbxFFmfA+9xHT5ZWhN1gDQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rollup": { + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.13.1.tgz", + "integrity": "sha512-hFi+fU132IvJ2ZuihN56dwgpltpmLZHZWsx27rMCTZ2sYwrqlgL5sECGy1eeV2lAihD8EzChBVVhsXci0wD4Tg==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.13.1", + "@rollup/rollup-android-arm64": "4.13.1", + "@rollup/rollup-darwin-arm64": "4.13.1", + "@rollup/rollup-darwin-x64": "4.13.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.13.1", + "@rollup/rollup-linux-arm64-gnu": "4.13.1", + "@rollup/rollup-linux-arm64-musl": "4.13.1", + "@rollup/rollup-linux-riscv64-gnu": "4.13.1", + "@rollup/rollup-linux-s390x-gnu": "4.13.1", + "@rollup/rollup-linux-x64-gnu": "4.13.1", + "@rollup/rollup-linux-x64-musl": "4.13.1", + "@rollup/rollup-win32-arm64-msvc": "4.13.1", + "@rollup/rollup-win32-ia32-msvc": "4.13.1", + "@rollup/rollup-win32-x64-msvc": "4.13.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.2.1.tgz", + "integrity": "sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vite": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.6.tgz", + "integrity": "sha512-FPtnxFlSIKYjZ2eosBQamz4CbyrTizbZ3hnGJlh/wMtCrlp1Hah6AzBLjGI5I2urTfNnpovpHdrL6YRuBOPnCA==", + "dev": true, + "dependencies": { + "esbuild": "^0.20.1", + "postcss": "^8.4.36", + "rollup": "^4.13.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-plugin-singlefile": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/vite-plugin-singlefile/-/vite-plugin-singlefile-2.0.1.tgz", + "integrity": "sha512-J74tfN6TE4fz0Hp7E1+dmVTmCpyazv4yuIpR6jd22Kq76d2CQDSQx3wDiHX8LT02f922V+YrLhRq2VIk/UYrig==", + "dev": true, + "dependencies": { + "micromatch": "^4.0.5" + }, + "engines": { + "node": ">18.0.0" + }, + "peerDependencies": { + "rollup": "^4.12.0", + "vite": "^5.1.4" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/RadiusTokenSync/package.json b/RadiusTokenSync/package.json new file mode 100644 index 0000000..0476f99 --- /dev/null +++ b/RadiusTokenSync/package.json @@ -0,0 +1,57 @@ +{ + "name": "@rangle/radius-figma-sync", + "version": "1.0.0", + "description": "Radius Figma Synchronizer", + "type": "module", + "scripts": { + "build:web": "npx vite build --minify esbuild --emptyOutDir=false", + "build": "esbuild widget-src/code.tsx --bundle --outfile=dist/code.js --target=es6", + "lint": "eslint --ext .ts,.tsx --ignore-pattern node_modules .", + "lint:fix": "eslint --ext .ts,.tsx --ignore-pattern node_modules --fix .", + "tsc": "tsc --noEmit -p widget-src", + "watch": "npm run build -- --watch" + }, + "author": "", + "license": "", + "devDependencies": { + "@figma/eslint-plugin-figma-plugins": "*", + "@figma/plugin-typings": "*", + "@figma/widget-typings": "*", + "@typescript-eslint/eslint-plugin": "^6.12.0", + "@typescript-eslint/parser": "^6.12.0", + "esbuild": "*", + "eslint": "^8.54.0", + "typescript": "^5.3.2", + "vite": "^5.2.6", + "vite-plugin-singlefile": "^2.0.1" + }, + "eslintConfig": { + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@figma/figma-plugins/recommended" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": [ + "./widget-src/tsconfig.json", + "./web-src/tsconfig.json" + ] + }, + "root": true, + "rules": { + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_" + } + ] + } + }, + "dependencies": { + "@create-figma-plugin/ui": "^3.1.0", + "preact": "^10.20.1" + } +} diff --git a/RadiusTokenSync/vite.config.ts b/RadiusTokenSync/vite.config.ts new file mode 100644 index 0000000..3479292 --- /dev/null +++ b/RadiusTokenSync/vite.config.ts @@ -0,0 +1,30 @@ +import path from "path"; +import { defineConfig } from "vite"; +import { viteSingleFile } from "vite-plugin-singlefile"; + +// https://vitejs.dev/config/ +export default defineConfig({ + root: "./web-src", + plugins: [viteSingleFile()], + resolve: { + alias: { + "!../css": path.resolve( + __dirname, + "./node_modules/@create-figma-plugin/ui/lib/css" + ), + }, + }, + build: { + target: "esnext", + assetsInlineLimit: 100000000, + chunkSizeWarningLimit: 100000000, + cssCodeSplit: false, + outDir: "../dist", + cssMinify: true, + rollupOptions: { + output: { + inlineDynamicImports: true, + }, + }, + }, +}); diff --git a/RadiusTokenSync/web-src/components/config.tsx b/RadiusTokenSync/web-src/components/config.tsx new file mode 100644 index 0000000..977ceb6 --- /dev/null +++ b/RadiusTokenSync/web-src/components/config.tsx @@ -0,0 +1,27 @@ +import { h, FunctionalComponent } from "preact"; +import { + Text, + Stack, + Textbox, + Layer, + IconCode16, +} from "@create-figma-plugin/ui"; + +export const ConfigForm: FunctionalComponent = () => { + return ( + + } value={false}> + Configure Repository to Export Tokens + + } value={false}> + + + } value={false}> + + + } value={false}> + + + + ); +}; diff --git a/RadiusTokenSync/web-src/index.html b/RadiusTokenSync/web-src/index.html new file mode 100644 index 0000000..7397a5a --- /dev/null +++ b/RadiusTokenSync/web-src/index.html @@ -0,0 +1,15 @@ + + + + + + + Radius Widget Template + + + +
+ + + + \ No newline at end of file diff --git a/RadiusTokenSync/web-src/index.tsx b/RadiusTokenSync/web-src/index.tsx new file mode 100644 index 0000000..a273eca --- /dev/null +++ b/RadiusTokenSync/web-src/index.tsx @@ -0,0 +1,14 @@ +import { h, Fragment, FunctionalComponent, render } from "preact"; +import { ConfigForm } from "./components/config"; + +import "@create-figma-plugin/ui/css/base.css"; + +export const App: FunctionalComponent = () => { + return ( + + + + ); +}; + +render(, document.getElementById("root")!); diff --git a/RadiusTokenSync/web-src/tsconfig.json b/RadiusTokenSync/web-src/tsconfig.json new file mode 100644 index 0000000..e8d65c4 --- /dev/null +++ b/RadiusTokenSync/web-src/tsconfig.json @@ -0,0 +1,78 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + /* Basic Options */ + // "incremental": true, /* Enable incremental compilation */ + "target": "es2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */, + "module": "ES2020" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, + "lib": [] /* Specify library files to be included in the compilation. */, + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */, + "jsxFactory": "h", + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */, + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an 'override' modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ + + /* Module Resolution Options */ + "moduleResolution": "Bundler" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + + /* Advanced Options */ + "skipLibCheck": true /* Skip type checking of declaration files. */, + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, + "paths": { + "react": ["../node_modules/preact/compat/"], + "react-dom": ["../node_modules/preact/compat/"] + } + }, + "include": ["./**/*.tsx", "./**/*.ts", "../vite.config.ts"] +} diff --git a/RadiusTokenSync/widget-src/code.tsx b/RadiusTokenSync/widget-src/code.tsx new file mode 100644 index 0000000..782e23f --- /dev/null +++ b/RadiusTokenSync/widget-src/code.tsx @@ -0,0 +1,43 @@ +import { EmptyPage } from "./ui/pages/empty-page"; + +const { widget } = figma; +const { AutoLayout, useSyncedState } = widget; + +export type WidgetConfiguration = { + name: string; + repository: string; + accessToken: string; + branch: string; + path: string; +}; + +export type LoadedTokens = { + inspectedAt: string; + collections: VariableCollection[]; +}; + +export function Widget() { + const [synchDetails, setSynchDetails] = useSyncedState( + "synchDetails", + null + ); + const [allTokens, setAllTokens] = useSyncedState( + "allGlobalTokens", + null + ); + + return ( + + new Promise((_res) => figma.showUI(__html__, { title: "This is it" })) + } + /> + ); +} + +widget.register(Widget); + +function strNow() { + const d = new Date(); + return `${d.toLocaleDateString()} ${d.toLocaleTimeString()}`; +} diff --git a/RadiusTokenSync/widget-src/common/component.utils.ts b/RadiusTokenSync/widget-src/common/component.utils.ts new file mode 100644 index 0000000..d3692a7 --- /dev/null +++ b/RadiusTokenSync/widget-src/common/component.utils.ts @@ -0,0 +1,100 @@ +import { getLocalVariable } from "../local-variable"; +import { getTokenStudioTokens } from "../token-studio"; +import { isInstance, isComponent, isComponentSet } from "./figma.types"; +import { ComponentUsage } from "./token.types"; +import { combineComponentUsage } from "./token.utils"; + +export const getMainComponent = async ( + node: BaseNode +): Promise => + isInstance(node) ? await node.getMainComponentAsync() : null; + +export const getComponentSet = async (node: BaseNode) => { + if (!node) { + console.log("No node selected"); + throw new Error("no node selected"); + } + + const main = isComponent(node) ? node : await getMainComponent(node); + if (!main) return undefined; + const { parent } = main; + + // get the component set + if (isComponentSet(parent)) return parent; + + return undefined; +}; + +export const visitComponents = ( + set: ComponentSetNode | undefined, + visitor: (c: ComponentNode) => T +) => { + if (!set) return []; + const result = set.children.map((component) => { + if (isComponent(component)) { + return visitor(component); + } + }); + return result; +}; + +export const getVariantMatrix = (set: ComponentSetNode | undefined) => { + if (!set) return []; + return visitComponents(set, (component) => component.variantProperties); +}; + +export const flatTokenList = ( + node: ComponentUsage, + name = "" +): Record => { + const fullName = `${name}.`; + const tokens = node.props.reduce((acc, prop) => { + const key = `${fullName}${prop.name}`; + const token = prop.value; + return { ...acc, [key]: token }; + }, {} as Record); + const childrenTokens = node.children.reduce( + (acc, child) => ({ + ...acc, + ...flatTokenList(child, `${fullName}${child.name}`), + }), + {} as Record + ); + return { + ...tokens, + ...childrenTokens, + }; +}; + +export const getTokensFromNode = async (node: ComponentNode | InstanceNode) => { + const tokenStudioValues = getTokenStudioTokens(node); + const localVariableUsage = await getLocalVariable(node); + const componentUsage: ComponentUsage = combineComponentUsage( + localVariableUsage, + tokenStudioValues + ); + return componentUsage; +}; + +export const isNotNil = (o: T | null | undefined): o is T => !!o; + +export const diffRecordValues = >( + a: T, + b: T +): Record => { + // record any tokens in b that are not identical to a + const diffEntries = Object.entries(b) + .map(([key, value]) => { + return a[key] === value ? null : [key, value]; + }) + .filter(isNotNil); + return Object.fromEntries(diffEntries); +}; + +export const getVariantList = (set: ComponentSetNode) => + set.children.filter(isComponent); + +export const getVariantListByFilter = ( + set: ComponentSetNode, + project: (variant: ComponentNode) => boolean +) => set.children.filter((v) => isComponent(v) && project(v)); diff --git a/RadiusTokenSync/widget-src/common/figma.types.ts b/RadiusTokenSync/widget-src/common/figma.types.ts new file mode 100644 index 0000000..86cd2f5 --- /dev/null +++ b/RadiusTokenSync/widget-src/common/figma.types.ts @@ -0,0 +1,24 @@ +export const isFrame = (n: BaseNode | null): n is FrameNode => + !!n && n.type === "FRAME"; +export const isInstance = (n: BaseNode | null): n is InstanceNode => + !!n && n.type === "INSTANCE"; +export const isComponent = (n: BaseNode | null): n is ComponentNode => + !!n && n.type === "COMPONENT"; +export const isComponentSet = (n: BaseNode | null): n is ComponentSetNode => + !!n && n.type === "COMPONENT_SET"; +export const isGroup = (n: BaseNode | null): n is GroupNode => + !!n && n.type === "GROUP"; + +export type Composite = + | FrameNode + | InstanceNode + | ComponentNode + | ComponentSetNode + | GroupNode; + +export const isComposite = (n: SceneNode): n is Composite => + isFrame(n) || + isInstance(n) || + isComponent(n) || + isComponentSet(n) || + isGroup(n); diff --git a/RadiusTokenSync/widget-src/common/generator.utils.ts b/RadiusTokenSync/widget-src/common/generator.utils.ts new file mode 100644 index 0000000..9efad6c --- /dev/null +++ b/RadiusTokenSync/widget-src/common/generator.utils.ts @@ -0,0 +1,132 @@ +import { TokenLayer, TokenLayers, TokenOutput } from "./token-parser.types"; +import { formatKey, toKebabCase } from "./token-parser.utils"; +import { TokeTypeName, inferVariableType, tokenTypeNames } from "./token.utils"; +import { + TokenCollection, + TokenVariable, + VariablesMode, +} from "./variables.utils"; + +const DEFAULT_MODE_NAME = "Mode 1"; +export const PARAM_SECTION_NAME = "section-name"; + +const formatLayerName = (modeName: string, description: string) => { + const visibleModeName = modeName !== DEFAULT_MODE_NAME ? modeName : undefined; + const cleanDescription = toKebabCase(description.replace(/\d+-/, "")); + + return visibleModeName + ? `${cleanDescription}--${toKebabCase(visibleModeName)}` + : cleanDescription; +}; + +const renderKey = (name: string) => `--${formatKey(name)}`; +const formatReference = (alias: string) => `{${renderKey(alias)}}`; + +const variableToTokenOutput = (variable: TokenVariable): TokenOutput => { + const { name, description } = variable; + const type = inferVariableType(variable); + return { + name: name.replaceAll("/", "."), + key: renderKey(name), + type, + description: description, + value: variable.alias + ? formatReference(variable.alias) + : renderValue(type, variable.value ?? ""), + }; +}; + +export const isArray = (o: T | T[]): o is T[] => Array.isArray(o); + +export const isNumber = (s: unknown): s is number => !Number.isNaN(Number(s)); +export const isRGB = (s: VariableValue): s is RGB => + !!s && typeof s === "object" && ["r", "g", "b"].every((n) => n in s); +export const isRGBA = (s: VariableValue): s is RGBA => + !!s && typeof s === "object" && ["r", "g", "b", "a"].every((n) => n in s); + +export const renderPrimitiveValue = (s: unknown) => String(s); +export const renderNumericValue = (n: number, unit: string) => `${n}${unit}`; +export const color = (c: number) => Math.round(c * 255); +export const renderRGB = ({ r, g, b }: RGB): string => + `rgb(${color(r)}, ${color(g)}, ${color(b)})`; +export const renderRGBA = ({ r, g, b, a }: RGBA): string => + `rgb(${color(r)}, ${color(g)}, ${color(b)}, ${a.toFixed(2)})`; + +export const renderValue = (typeName: string, v: VariableValue): string => { + const type = tokenTypeNames.find((t) => t === (typeName as TokeTypeName)); + switch (type) { + case "color": + case "textColor": + case "backgroundColor": + if (isRGBA(v)) return renderRGBA(v); + if (isRGB(v)) return renderRGB(v); + break; + case "spacing": + case "width": + case "height": + case "margin": + case "padding": + case "grid": + case "size": + case "borderRadius": + case "borderWidth": + if (Array.isArray(v)) + return `${v.map((n) => renderNumericValue(n, "px"))}`; + if (isNumber(v)) return renderNumericValue(v, "px"); + break; + case "opacity": + if (isNumber(v)) return renderNumericValue(v, "%"); + } + return renderPrimitiveValue(v); +}; + +const SCREEN_SIZE_VARIABLES = + /(screen|grid)[.-/ ](minWidth|maxWidth|min[-./ ][Ww]idth|max[-./ ][Ww]idth)/; + +const hasScreenSizes = (v: T) => + SCREEN_SIZE_VARIABLES.test(v.name) && v.value !== undefined; + +const renderScreenSizes = ({ name, value }: T) => { + const [_, __, param] = name.match(SCREEN_SIZE_VARIABLES) ?? []; + return { [`screen-${formatKey(param)}`]: value }; +}; + +const generateParameters = ({ name, variables }: VariablesMode) => { + const screenSizes = variables + .filter(hasScreenSizes) + .reduce((acc, v) => ({ ...acc, ...renderScreenSizes(v) }), {}); + if (Object.keys(screenSizes).length > 0) return screenSizes; + return { + [PARAM_SECTION_NAME]: toKebabCase(name), + }; +}; + +export const generateLayerFile = ( + collections: TokenCollection[] +): TokenLayers => { + const layers = collections.flatMap( + ({ name: layerName, modes }): TokenLayer[] => { + const isStatic = modes.length === 1; + return modes.map( + ({ name: modeName, variables }) => + ({ + name: formatLayerName(modeName, layerName), + dependencies: [], + parameters: { + ...(isStatic + ? {} + : generateParameters({ name: modeName, variables })), + }, + isStatic, + variables: variables.map(variableToTokenOutput), + } satisfies TokenLayer) + ); + } + ); + + const order: string[] = layers.map(({ name }) => name); + return { + layers, + order, + }; +}; diff --git a/RadiusTokenSync/widget-src/common/token-parser.types.ts b/RadiusTokenSync/widget-src/common/token-parser.types.ts new file mode 100644 index 0000000..4da7e75 --- /dev/null +++ b/RadiusTokenSync/widget-src/common/token-parser.types.ts @@ -0,0 +1,212 @@ +// ---- +/* GENERIC JSON STRUCTURES TO DESCRIBE THE DATA FILE */ +/** Leaf node containing a string value */ + +export type JSONLeaf = { + value: string; + type: string; + description?: string; +}; + +/** Composite node containing a more complex value */ +export type JSONCompositeLeaf = { + type: string; + value: Record | Array>; + description?: string; +}; + +/** Generic node */ +export type JSONStructure = { + [key: string]: JSONLeaf | JSONCompositeLeaf | JSONStructure; +}; + +/** Root structure of the JSON file */ +export type TokenStructure = Record & { + $themes: unknown[]; + $metadata: { + tokenSetOrder: string[]; + }; +}; + +/** Output Token Descriptor */ +export type TokenOutput = { + name: string; + key: string; + type: string; + subtypes?: string[]; + subtoken?: string; + description?: string; + value: string; + rawValue?: string; +}; + +/* REFERENCE TOKEN */ + +type BasicReference = { + key: string; + sources: string[]; + isStatic: boolean; +}; + +export type SingleTokenReference = BasicReference & { + token: TokenOutput; +}; + +export type CompositeTokenReference = BasicReference & { + references: Record; + isReference: true; +}; + +export type TokenReference = SingleTokenReference | CompositeTokenReference; + +export const isSingleTokenReference = ( + u: TokenReference +): u is SingleTokenReference => + isObject(u) && + (u).sources !== undefined && + (u).token !== undefined && + !('isReference' in u); + +export const isCompositeTokenReference = ( + u: TokenReference +): u is CompositeTokenReference => + isObject(u) && + (u).sources !== undefined && + (u).references !== undefined && + (u).isReference === true; + +export type ReferenceMap = Record; + +/* SPECIAL TOKEN STRUCTURES TO CREATE SHORTHAND DEFINITIONS *EXPERIMENTAL* */ + +export type BoxShadowDefinition = { + color: string; + type: 'dropShadow'; // there should be a 2nd kind + x: string; + y: string; + blur: string; + spread: string; +}; + +export type CompositeLeafBoxShadow = { + type: 'boxShadow'; + value: Array | BoxShadowDefinition; + description?: string; +}; + +export const isCompositeLeafBoxShadow = ( + u: JSONCompositeLeaf +): u is CompositeLeafBoxShadow => + (u).type === 'boxShadow'; + +export type CompositeLeafTypography = { + type: 'typography'; + description?: string; + value: { + fontFamily: string; + fontWeight: string; + lineHeight: string; + fontSize: string; + letterSpacing: string; + paragraphSpacing: string; + textCase: string; + textDecoration: string; + }; +}; + +export type TokenLayer = { + variables: TokenOutput[]; + name: string; + parameters: Record; + dependencies: string[]; + isStatic: boolean; +}; + +export type TokenLayers = { + layers: TokenLayer[]; + order: string[]; +}; + +export const isCompositeLeafTypography = ( + u: JSONCompositeLeaf +): u is CompositeLeafTypography => + (u).type === 'typography' && + typeof (u).value === 'object' && + !!(u).value.fontFamily && + !!(u).value.fontSize && + !!(u).value.fontWeight && + !!(u).value.lineHeight; + +/* TYPE GUARDS TO HELP IDENTIFY THE TYPE OF NODES */ + +export const isString = (u: unknown): u is string => typeof u === 'string'; + +export const isArray = (u: T | T[]): u is T[] => + typeof u === 'object' && Array.isArray(u); + +export const isJSONLeaf = (u: unknown): u is JSONLeaf => + typeof (u).type === 'string' && + typeof (u).value === 'string'; + +export const isCompositeLeaf = (u: unknown): u is JSONCompositeLeaf => + typeof (u).type === 'string' && + typeof (u).value === 'object'; + +export const isTokenStudioJSON = (u: unknown): u is TokenStructure => + typeof (u).$themes === 'object' && + isArray((u).$themes) && + typeof (u).$metadata === 'object' && + typeof (u).$metadata.tokenSetOrder === 'object' && + isArray((u).$metadata.tokenSetOrder); + +/* GENERATOR MAP TYPES */ + +export type GeneratorMappingFrom = string | RegExp; + +export type GeneratorMappingTo = + | string + | ((value: string) => string) + | ((value: string, match: RegExpMatchArray | null) => string); + +export type GeneratorMappingGenericDictionaryItem = readonly [ + from: GeneratorMappingFrom, + to: GeneratorMappingTo +]; + +export type GeneratorMappingSpecificDictionaryItem = readonly [ + tokenPattern: RegExp, + item: Array +]; + +export type GeneratorMappingDictionaryItem = + | GeneratorMappingGenericDictionaryItem + | GeneratorMappingSpecificDictionaryItem; + +export type GeneratorMappingDictionary = { + [template: string]: Array; +}; + +export type GeneratorMappingFunction = (key: string, value: string) => string; + +export const isGeneratorMappingGenericDictionaryItem = ( + u: unknown +): u is GeneratorMappingGenericDictionaryItem => + isArray(u) && + u.length === 2 && + (isString(u[0]) || u[0] instanceof RegExp) && + (isString(u[1]) || typeof u[1] === 'function'); + +export const isGeneratorMappingSpecificDictionaryItem = ( + u: unknown +): u is GeneratorMappingSpecificDictionaryItem => + isArray(u) && + u.length === 2 && + u[0] instanceof RegExp && + isArray(u[1]) && + u[1].every(isGeneratorMappingGenericDictionaryItem); + +export const isObject = (item: unknown): item is Record => + typeof item === 'object' && item !== null && !Array.isArray(item); + +export const isTokenOutput = (item: unknown): item is TokenOutput => + isObject(item) && 'key' in item && 'value' in item && 'type' in item; diff --git a/RadiusTokenSync/widget-src/common/token-parser.utils.ts b/RadiusTokenSync/widget-src/common/token-parser.utils.ts new file mode 100644 index 0000000..f1dced9 --- /dev/null +++ b/RadiusTokenSync/widget-src/common/token-parser.utils.ts @@ -0,0 +1,130 @@ +import { + TokenOutput, + JSONStructure, + GeneratorMappingDictionary, + GeneratorMappingFunction, + isGeneratorMappingSpecificDictionaryItem, + isString, +} from "./token-parser.types"; + +/** convert names to kebab-case in case they come as CamelCase or pascalCase */ +export const toKebabCase = (s: string) => + s + .replace(/\./g, "-") + .replace(/[^A-Za-z0-9_-]/g, " ") + .replace(/([A-Z]+)/g, " $1") + .replace(/\s+/g, " ") + .trim() + .toLowerCase() + .replace(/\s/g, "-") + .replace(/--/g, "-"); + +/** create a formatted key that's more css-friendly */ +export const formatKey = (str: string) => toKebabCase(str); + +export const renderKey = >( + { name, type }: T, + subtoken?: string +): string | undefined => { + if (type !== "other") { + const cleanName = name + .replace(type, "") + .replace("..", ".") + .replace(/^[.]/, ""); + return `--${type}-${formatKey(cleanName)}${ + subtoken ? `-${toKebabCase(subtoken)}` : "" + }`; + } else renderOtherKey(name, subtoken); +}; + +export const renderOtherKey = (name: string, subtoken?: string): string => { + const [layer, type, ...rest] = name.split("."); + return `--${type}-${formatKey(`${layer}.${rest.join(".")}`)}${ + subtoken ? `-${toKebabCase(subtoken)}` : "" + }`; +}; + +export const renderName = >( + { name }: T, + subtoken?: string +): string => `${name}${subtoken ? `.${subtoken}` : ""}`; + +export const isEqual = >( + a: T, + b: T +): boolean => { + const aProps = Object.getOwnPropertyNames(a); + const bProps = Object.getOwnPropertyNames(b); + if (aProps.length !== bProps.length) return false; + return aProps.every((propName, index) => a[propName] === b[bProps[index]]); +}; +const expressionPattern = + /^\d+(\.\d+)?(rem|px)?\s*[+\-*/]\s*\d+(\.\d+)?(rem|px)?(?:\s*[+\-*/]\s*\d+(\.\d+)?(rem|px)?)*$/g; +export const isExpression = (input: string): boolean => { + return !!input.replace(" ", "").match(expressionPattern); +}; + +export const variableReferenceRegex = /\{(--[\w-]+)\}/; +export const isVariableReference = (value: string) => + variableReferenceRegex.test(value); + +export const hasParameters = (parameters: Record) => + Object.keys(parameters).filter((key) => key !== "description").length > 0; + +export const removeDuplicates = (arr: T[]): T[] => + arr.filter((value, index, array) => array.indexOf(value) === index); + +export const processParameters = ( + specialNames: string[], + dataSet: JSONStructure +) => + Object.entries(dataSet) + .filter( + ([name, { value }]) => + specialNames.includes(name) && typeof value === "string" + ) + .reduce( + (res, [name, { value }]) => ({ ...res, [name]: value as string }), + {} as Record + ); + +/** createReplaceFunction + * parse the mapping dictionary and return a function that takes a key and a value and returns the value with the replacements + * @param mapping Dictionary of mappings to replace values + * @returns a function that takes a key and a value and returns the value with the replacements + */ +export const createReplaceFunction = ( + mapping: GeneratorMappingDictionary[string] +): GeneratorMappingFunction => { + const items = mapping || []; + const replacingFunctions = items.flatMap((item) => { + if (isGeneratorMappingSpecificDictionaryItem(item)) { + const [tokenRegex, specificItems] = item; + return specificItems.map(([from, to]) => { + const regex = isString(from) ? new RegExp(from) : from; + + return (key: string, value: string) => + tokenRegex.test(key) && regex.test(value) + ? value.replace( + regex, + isString(to) ? to : to(value, value.match(regex)) + ) + : value; + }); + } else { + const [from, to] = item; + const regex = isString(from) ? new RegExp(`^${from}$`) : from; + + return (_: string, value: string) => + regex.test(value) + ? value.replace( + regex, + isString(to) ? to : to(value, value.match(regex)) + ) + : value; + } + }); + + return (key: string, value: string) => + replacingFunctions.reduce((acc, fn) => fn(key, acc), value); +}; diff --git a/RadiusTokenSync/widget-src/common/token.types.ts b/RadiusTokenSync/widget-src/common/token.types.ts new file mode 100644 index 0000000..92b31a7 --- /dev/null +++ b/RadiusTokenSync/widget-src/common/token.types.ts @@ -0,0 +1,24 @@ +export type TokenUse = { + name: string; + value: string; + from: "variable" | "token studio"; +}; + +export const isTokenUse = (o: unknown): o is TokenUse => + !!o && typeof o === "object" && "name" in o && "value" in o && "from" in o; + +export type ComponentUsage = { + id: string; + name: string; + props: TokenUse[]; + children: ComponentUsage[]; +}; + +export type ComponentTokens = { + name: string; + attribute: string; + subjects: string[]; + tokens: [string, string][]; +}; + +export type TokenRecords = Record>; diff --git a/RadiusTokenSync/widget-src/common/token.utils.ts b/RadiusTokenSync/widget-src/common/token.utils.ts new file mode 100644 index 0000000..feb8491 --- /dev/null +++ b/RadiusTokenSync/widget-src/common/token.utils.ts @@ -0,0 +1,257 @@ +import { ComponentUsage } from "./token.types"; +import { TokenVariable } from "./variables.utils"; + +export const tokenTypeNames = [ + "color", + "spacing", + "fontWeight", + "lineHeight", + "opacity", + "stroke", + "strokeWidth", + "width", + "height", + "textColor", + "backgroundColor", + "borderWidth", + "borderRadius", + "animation", + "margin", + "padding", + // two custom types + "grid", + "size", +] as const; + +export type TokeTypeName = (typeof tokenTypeNames)[number]; + +const isTokenType = (t: unknown): t is TokeTypeName => + tokenTypeNames.indexOf(t as TokeTypeName) !== -1; + +export const isCamelCase = (s: string) => + /^[a-z0-9]+(?:[A-Z][a-z0-9]*)*$/.test(s) && !/[A-Z]{2}/.test(s); + +// TODO: move to tests after configuring vitest +// console.log(isCamelCase("test")); +// console.log(isCamelCase("test noveo")); +// console.log(isCamelCase("test_")); +// console.log(isCamelCase("Dstest")); +// console.log(isCamelCase("nodaSmellSa")); +// console.log(isCamelCase("nodaSSmellSa")); +// console.log(isCamelCase("NADA")); +// console.log(isCamelCase("t2est")); +// console.log(isCamelCase("2")); +// console.log(isCamelCase("2xl")); + +export type TokenRule = { + title: string; + validate: ( + name: string + ) => readonly [boolean, string] | readonly [boolean, string, string[]]; +}; + +const v3Tokens = true; + +export const tokenRules: Record = { + "two-segments": { + title: "non-primitive token names must have at least three segments", + validate: (name) => { + const segments = name.split("."); + const [first, _second, third] = segments; + if (third) return [true, ""]; + const tokenType = isTokenType(first) ? "primitive" : "semantic"; + if (tokenType === "primitive" && segments.length === 2) return [true, ""]; + if (tokenType === "semantic" && segments.length > 2) return [true, ""]; + return [ + false, + `${tokenType} token ${name} does not have the right number of segments: + for primitive tokens: {type}.{name} + for semantic tokens: {subject}.{type}.{attributes}... + `, + ]; + }, + }, + "valid-case": { + title: "token name segments must be in 'camelCase'", + validate: (name) => { + const segments = name.split("."); + const invalidSegments = segments.filter((s) => !isCamelCase(s)); + return invalidSegments.length === 0 + ? [true, ""] + : [ + false, + `Token ${name} has segments with the wrong format. Segments ${invalidSegments + .map((s) => `'${s}'`) + .join(", ")} are not in camelCase.`, + invalidSegments, + ]; + }, + }, + "valid-type": { + title: "token name must have a valid type", + validate: (name) => { + const segments = name.split("."); + const [first, second] = segments; + const tokenType = segments.length === 2 ? "primitive" : "semantic"; + const segment = tokenType === "primitive" ? first : second; + if (isTokenType(segment)) return [true, ""]; + else { + return [ + false, + `${tokenType} token ${name} has an invalid type '${segment}'. + Valid types are: ${tokenTypeNames.join(", ")}`, + [segment], + ]; + } + }, + }, +}; + +export const v3TokenRules: Record = { + "two-segments": { + title: "non-primitive token names must have at least three segments", + validate: (name) => { + const segments = name.split("."); + const [_layer, first, _second, third] = segments; + if (third) return [true, ""]; + const tokenType = isTokenType(first) ? "primitive" : "semantic"; + if (tokenType === "primitive" && segments.length === 3) return [true, ""]; + if (tokenType === "semantic" && segments.length > 3) return [true, ""]; + return [ + false, + `${tokenType} token ${name} does not have the right number of segments: + for primitive tokens: {layer}.{type}.{name} + for semantic tokens: {layer}.{subject}.{type}.{attributes}... + `, + ]; + }, + }, + "valid-case": { + title: "token name segments must be in 'camelCase'", + validate: (name) => { + const segments = name.split("."); + const invalidSegments = segments.filter((s) => !isCamelCase(s)); + return invalidSegments.length === 0 + ? [true, ""] + : [ + false, + `Token ${name} has segments with the wrong format. Segments ${invalidSegments + .map((s) => `'${s}'`) + .join(", ")} are not in camelCase.`, + invalidSegments, + ]; + }, + }, + "valid-type": { + title: "token name must have a valid type", + validate: (name) => { + const segments = name.split("."); + const [_layer, first, second] = segments; + const tokenType = segments.length === 3 ? "primitive" : "semantic"; + const segment = tokenType === "primitive" ? first : second; + if (isTokenType(segment)) return [true, ""]; + else { + return [ + false, + `${tokenType} token ${name} has an invalid type '${segment}'. + Valid types are: ${tokenTypeNames.join(", ")}`, + [segment], + ]; + } + }, + }, +}; + +/// TODO: move this to a test file +// console.log("first.second.third".match(/([^.])*\.([^.])*\.([^.])*/)); +// + +export type TokenError = { + key: string; + title: string; + message: string; + segments: string[]; +}; + +type ReturnTuple = [ok: boolean, errs: TokenError[]]; + +export const validateTokenName = ( + name: string +): readonly [ + name: string, + ok: boolean, + errs: TokenError[], + errorsBySegment: Record +] => { + const printableName = name.replaceAll("/", "."); + // TODO: inject this boolean from the UI + const rules = v3Tokens ? v3TokenRules : tokenRules; + const [ok, errs] = Object.entries(rules).reduce( + ([ok, errs], [key, rule]) => { + const [valid, errMsg, segments] = rule.validate(printableName); + return ok && valid + ? [true, []] + : [ + false, + [ + ...errs, + { + key, + title: rule.title, + message: errMsg, + segments: segments ?? [], + } satisfies TokenError, + ], + ]; + }, + [true, []] + ); + + const errorsBySegment = errs.reduce((res, err) => { + return { + ...res, + ...err.segments.reduce( + (segmentIndex, segment) => ({ + ...segmentIndex, + [segment]: [...(res[segment] ?? []), err], + }), + {} as Record + ), + }; + }, {} as Record); + + return [printableName, ok, errs, errorsBySegment] as const; +}; + +export const calculateSubjectsFromProps = (componentProps: string[]) => + componentProps.reduce((subjects, prop) => { + const [_, _layer, subject, _type, _attributes] = + prop.replaceAll("/", ".").match(/([^.]*)\.([^.]*)\.([^.]*)/) ?? []; + if (!subject || subjects.indexOf(subject) !== -1 || isTokenType(subject)) + return subjects; + else return [...subjects, subject]; + }, [] as string[]); + +export const inferVariableType = (variable: TokenVariable): string => { + // from type and name + const segments = variable.name.split("/"); + const [first, second] = segments; + + if (tokenTypeNames.indexOf(second as TokeTypeName) !== -1) return second; + if (tokenTypeNames.indexOf(first as TokeTypeName) !== -1) return first; + return variable.type.toLocaleLowerCase(); +}; + +export const combineComponentUsage = ( + a: ComponentUsage, + b: ComponentUsage +): ComponentUsage => { + return { + id: a.id, + name: a.name, + props: [...a.props, ...b.props], + children: a.children.map((ac, index) => + combineComponentUsage(ac, b.children[index]) + ), + }; +}; diff --git a/RadiusTokenSync/widget-src/common/variables.utils.ts b/RadiusTokenSync/widget-src/common/variables.utils.ts new file mode 100644 index 0000000..d8a769f --- /dev/null +++ b/RadiusTokenSync/widget-src/common/variables.utils.ts @@ -0,0 +1,117 @@ +export type TokenVariable = { + name: string; + value?: VariableValue; + alias?: string; + description?: string; + type: string; +}; + +export type VariablesMode = { + name: string; + variables: TokenVariable[]; +}; + +export type TokenCollection = { + name: string; + modes: VariablesMode[]; +}; + +// type guard for VariableValue is alias +function isVariableAlias(value: VariableValue): value is VariableAlias { + if (typeof value !== "object") return false; + return (value as VariableAlias).type === "VARIABLE_ALIAS"; +} + +export const getAllLocalVariableTokens = async () => { + const variableCollections = + await figma.variables.getLocalVariableCollectionsAsync(); + const collections = [] as TokenCollection[]; + + // const rest = await figma.variables.getLocalVariablesAsync(); + + // const variablesToDelete = [ + // "VariableID:5394:21518", + // "VariableID:5393:21487", + // "VariableID:5388:21427", + // "VariableID:5393:21483", + // "VariableID:5393:21484", + // ]; + + // variablesToDelete.forEach(async (variableId) => { + // const variableToDelete = + // await figma.variables.getVariableCollectionByIdAsync(variableId); + // variableToDelete?.remove(); + // }); + + // console.log( + // "====>", + // rest + // .filter(({ name }) => name.indexOf("/") === -1) + // .map((v) => [v.name, v.key, v.id, v.scopes]) + // ); + + // iterate through all the collections + for (let x = 0; x < variableCollections.length; x++) { + const collection = variableCollections[x]; + if (collection.name === "03-color modes") + console.log( + "==> Collection", + await Promise.all( + collection.variableIds.map((id) => + figma.variables.getVariableByIdAsync(id) + ) + ).then((variables) => + variables.map((v) => [v?.id, v?.name, v?.resolvedType]) + ) + ); + const modes = {} as { [key: string]: VariablesMode }; + for (let j = 0; j < collection.modes.length; j++) { + modes[collection.modes[j].modeId] = { + name: collection.modes[j].name, + variables: [], + }; + } + + // through all the variables + for (let i = 0; i < collection.variableIds.length; i++) { + const variableId = collection.variableIds[i]; + const variable = await figma.variables.getVariableByIdAsync(variableId); + + if (!variable) continue; + + // iterate through all the variables + for (let j = 0; j < collection.modes.length; j++) { + const mode = collection.modes[j]; + const value = variable?.valuesByMode[mode.modeId]; + + if (value === undefined || value === null) continue; + + // if it's a variable id, we need to find the name of it + if (isVariableAlias(value)) { + const alias = await figma.variables.getVariableByIdAsync(value.id); + if (!alias) continue; + modes[mode.modeId].variables.push({ + name: variable.name, + alias: alias.name, + type: alias.resolvedType, + description: alias.description, + }); + } else { + // not a variable alias + modes[mode.modeId].variables.push({ + name: variable.name, + value: value, + type: variable.resolvedType, + description: variable.description, + }); + } + } + } + + collections.push({ + name: collection.name, + modes: Object.values(modes), + }); + } + return collections; +}; diff --git a/RadiusTokenSync/widget-src/local-variable/index.tsx b/RadiusTokenSync/widget-src/local-variable/index.tsx new file mode 100644 index 0000000..0a86429 --- /dev/null +++ b/RadiusTokenSync/widget-src/local-variable/index.tsx @@ -0,0 +1 @@ +export { getLocalVariables as getLocalVariable } from "./local-variable"; diff --git a/RadiusTokenSync/widget-src/local-variable/local-variable.tsx b/RadiusTokenSync/widget-src/local-variable/local-variable.tsx new file mode 100644 index 0000000..b5ae513 --- /dev/null +++ b/RadiusTokenSync/widget-src/local-variable/local-variable.tsx @@ -0,0 +1,85 @@ +import { isComposite } from "../common/figma.types"; +import { ComponentUsage, TokenUse, isTokenUse } from "../common/token.types"; + +// type BoundVariables = SliceNode['boundVariables']; +type KeysOfBoundVariables = SceneNode["boundVariables"] extends infer BV + ? BV extends Record + ? keyof BV + : never + : never; + +export async function getLocalVariables( + node: SceneNode +): Promise { + const variables = node?.boundVariables; + if (!variables) { + console.log("no boundVariables: returning empty"); + return { + id: node.id, + name: node.name, + props: [], + children: [], + }; + } + + console.log(`'${node.name}'`, "variables:", variables); + + const children = isComposite(node) + ? node.children.map(getLocalVariables) + : []; + + if (!isComposite(node)) console.log("WEIRD CHILDREN", node.type); + + // for each key in variables we need to make a async query to get the current value of the variable + const props = await Promise.all( + (Object.keys(variables) as KeysOfBoundVariables[]).flatMap( + async (daKey): Promise => { + const key = String(daKey); + const variableValue = variables[daKey]; + if (!variableValue) return [] satisfies TokenUse[]; + if (Array.isArray(variableValue)) { + // for each item in the array get the get variable by id + const daList = await Promise.all( + variableValue.flatMap>( + async (variable): Promise => { + const value = await figma.variables.getVariableByIdAsync( + variable.id + ); + return value + ? ({ + name: key, + value: value.name, + from: "variable", + } satisfies TokenUse) + : undefined; + } + ) + ).then((list) => list.filter(isTokenUse)); + return daList; + } else if (typeof variableValue.id === "string") { + const value = await figma.variables.getVariableByIdAsync( + variableValue.id + ); + const alternateList = value + ? ([ + { + name: key, + value: value.name, + from: "variable", + }, + ] satisfies TokenUse[]) + : ([] satisfies TokenUse[]); + return alternateList; + } + return [] satisfies TokenUse[]; + } + ) + ); + + return { + id: node.id, + name: node.name, + props: props.flatMap((v) => v), + children: await Promise.all(children), + } satisfies ComponentUsage; +} diff --git a/RadiusTokenSync/widget-src/token-list/component-docs.tsx b/RadiusTokenSync/widget-src/token-list/component-docs.tsx new file mode 100644 index 0000000..5911861 --- /dev/null +++ b/RadiusTokenSync/widget-src/token-list/component-docs.tsx @@ -0,0 +1,184 @@ +import { ComponentUsage } from "../common/token.types"; +import { calculateSubjectsFromProps } from "../common/token.utils"; +import { Icon16px, IconProps } from "../ui/components/icon"; +import { Pill } from "../ui/components/pill"; +import { PropDocs } from "./prop-docs"; + +const { widget } = figma; +const { Text, AutoLayout } = widget; + +export type ComponentDocsProps = { + usage: ComponentUsage | undefined; + isChildren?: boolean; + isDeleted: (id: string) => boolean; + deleteComponent: (id: string) => void; +}; + +export const EmptyComponentDocs = () => ( + + + + No component selected + + + Select a component and click the 'Add Component' button + + + +); + +export const ComponentDocs: FunctionalWidget = ({ + usage, + deleteComponent, + isChildren, + isDeleted, +}) => { + if (!usage) return ; + const { id, name, props, children } = usage; + const subjects = calculateSubjectsFromProps(props.map(({ value }) => value)); + const [componentIcon, titleTextSize]: [IconProps["icon"], number] = isChildren + ? ["instance", 14] + : ["component", 20]; + + const childrenToRender = children.filter(({ id }) => !isDeleted(id)); + return ( + + + + + + {name} + + {isChildren ? ( + deleteComponent(id)} /> + ) : ( + <> + )} + + {subjects.length > 0 ? ( + + + + subjects: + + {subjects.map((subject, idx) => ( + {subject} + ))} + + + ) : ( + <> + )} + + + {props.map((prop) => ( + + ))} + + {childrenToRender.length > 0 && ( + + {childrenToRender.map((subcomponent, key) => ( + + ))} + + )} + + + ); +}; diff --git a/RadiusTokenSync/widget-src/token-list/index.ts b/RadiusTokenSync/widget-src/token-list/index.ts new file mode 100644 index 0000000..7cf3ef9 --- /dev/null +++ b/RadiusTokenSync/widget-src/token-list/index.ts @@ -0,0 +1,3 @@ +export * from "../ui/components/widget-header"; +export * from "./component-docs"; +export * from "./prop-docs"; diff --git a/RadiusTokenSync/widget-src/token-list/prop-docs.tsx b/RadiusTokenSync/widget-src/token-list/prop-docs.tsx new file mode 100644 index 0000000..13c9d4a --- /dev/null +++ b/RadiusTokenSync/widget-src/token-list/prop-docs.tsx @@ -0,0 +1,144 @@ +const { widget } = figma; +const { Text, AutoLayout } = widget; +import { TokenUse } from "../common/token.types"; +import { TokenError, validateTokenName } from "../common/token.utils"; +import { Icon16px } from "../ui/components/icon"; + +export type PropUsage = { + prop: TokenUse; +}; +export const PropDocs: FunctionalWidget = ({ prop }) => { + return ( + <> + + + {prop.name}: + + + + + ); +}; + +export type PropValueType = { + type: "variable" | "token studio"; + value: string; +}; + +const htmlRenderError = (err: TokenError) => + `
${err.title}
${err.message}
`; +const htmlRenderErrorList = (errs: TokenError[]) => + `
${errs.map( + htmlRenderError + )}
`; + +const showErrors = async ( + errors: Record | TokenError[] +) => { + const errorsRendered = Array.isArray(errors) + ? htmlRenderErrorList(errors) + : Object.entries(errors) + .map( + ([segment, errors]) => + `

${segment}

${htmlRenderErrorList(errors)}` + ) + .join("\n"); + + await new Promise((_resolve) => + figma.showUI(errorsRendered, { + visible: true, + }) + ); +}; + +const RedSgmt: FunctionalWidget void }> = ({ + children, + onClick, +}) => ( + onClick()} + > + {children} + +); + +const Sgmt: FunctionalWidget = ({ children }) => ( + + {children} + +); + +function renderName( + printableName: string, + errorsBySegment: Record, + ok: boolean +) { + const segments = printableName.split("."); + // TODO: inject render function from the outside to be able to create a nicer floating hint + const renderedName = ok ? ( + {printableName} + ) : ( + segments.flatMap((segment, index) => [ + errorsBySegment[segment] ? ( + showErrors(errorsBySegment[segment])}> + {segment} + + ) : ( + {segment} + ), + {index < segments.length - 1 ? "." : ""}, + ]) + ); + return renderedName; +} + +export const PropValue: FunctionalWidget = ({ type, value }) => { + const [name, valid, errors, errorsBySegment] = validateTokenName(value); + return ( + <> + showErrors(errors)} + verticalAlignItems="center" + > + + + + {renderName(name, errorsBySegment, valid)} + + + + ); +}; diff --git a/RadiusTokenSync/widget-src/token-list/variants-docs.tsx b/RadiusTokenSync/widget-src/token-list/variants-docs.tsx new file mode 100644 index 0000000..995187b --- /dev/null +++ b/RadiusTokenSync/widget-src/token-list/variants-docs.tsx @@ -0,0 +1,199 @@ +import { ComponentTokens, TokenRecords } from "../common/token.types"; +import { calculateSubjectsFromProps } from "../common/token.utils"; +import { Icon16px } from "../ui/components/icon"; +import { Pill } from "../ui/components/pill"; +import { PropDocs } from "./prop-docs"; + +const { widget } = figma; +const { Text, AutoLayout } = widget; + +export type VariantsDocsProps = { + name: string; + tokenList: TokenRecords; +}; + +export const EmptyComponentDocs = () => ( + + + + No component selected + + + Select a component and click the 'Add Component' button + + + +); + +export const VariantsDocs: FunctionalWidget = ({ + name, + tokenList, +}) => { + const variants = tokenList && Object.entries(tokenList); + if (!variants || variants.length < 1) return ; + + const items: ComponentTokens[] = variants.map(([attribute, tokenDict]) => { + const subjects = calculateSubjectsFromProps(Object.values(tokenDict)); + return { + name, + attribute, + subjects, + tokens: Object.entries(tokenDict), + } satisfies ComponentTokens; + }); + + return ( + + {items.map(({ name, subjects, attribute, tokens }) => ( + <> + + + + + {name} + + + {attribute} + + + {subjects.length > 0 ? ( + + + + subjects: + + {subjects.map((subject, idx) => ( + {subject} + ))} + + + ) : ( + + )} + + {tokens.length > 0 ? ( + + {tokens.map(([key, value]) => ( + + ))} + + ) : ( + + Same properties as default + + )} + + ))} + + ); +}; diff --git a/RadiusTokenSync/widget-src/token-studio/index.tsx b/RadiusTokenSync/widget-src/token-studio/index.tsx new file mode 100644 index 0000000..d8d71f5 --- /dev/null +++ b/RadiusTokenSync/widget-src/token-studio/index.tsx @@ -0,0 +1 @@ +export { getTokenStudioTokens } from './token-studio'; \ No newline at end of file diff --git a/RadiusTokenSync/widget-src/token-studio/token-studio.tsx b/RadiusTokenSync/widget-src/token-studio/token-studio.tsx new file mode 100644 index 0000000..68893b6 --- /dev/null +++ b/RadiusTokenSync/widget-src/token-studio/token-studio.tsx @@ -0,0 +1,31 @@ +import { isComposite } from "../common/figma.types"; +import { ComponentUsage, TokenUse } from "../common/token.types"; + +export function getTokenStudioTokens(node: SceneNode): ComponentUsage { + const sharedTokens = node.getSharedPluginDataKeys("tokens"); + + const children = isComposite(node) + ? node?.children?.map(getTokenStudioTokens) + : []; + const props = sharedTokens.reduce((tokens: TokenUse[], token: string) => { + return token === "version" + ? tokens + : [ + ...tokens, + { + name: token, + value: node + .getSharedPluginData("tokens", token) + .replace(/^["](.*)["]$/, "$1"), + from: "token studio", + } satisfies TokenUse, + ]; + }, [] as TokenUse[]); + + return { + id: node.id, + name: node.name, + props: props.flatMap((v) => v), + children, + } satisfies ComponentUsage; +} diff --git a/RadiusTokenSync/widget-src/tsconfig.json b/RadiusTokenSync/widget-src/tsconfig.json new file mode 100644 index 0000000..45c144e --- /dev/null +++ b/RadiusTokenSync/widget-src/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "jsx": "react", + "jsxFactory": "figma.widget.h", + "jsxFragmentFactory": "figma.widget.Fragment", + "target": "es2016", + "lib": ["es2016", "ESNext"], + "strict": true, + "typeRoots": ["../node_modules/@types", "../node_modules/@figma"], + "moduleResolution": "node" + } +} diff --git a/RadiusTokenSync/widget-src/types.d.ts b/RadiusTokenSync/widget-src/types.d.ts new file mode 100644 index 0000000..1127db8 --- /dev/null +++ b/RadiusTokenSync/widget-src/types.d.ts @@ -0,0 +1,44 @@ +type StyleNodeTypes = { + name: string; + value: string; + type?: "token" | "error" | "default"; + shouldBeToken?: boolean; +}; +type StyleNode = { + name: string; + type: string; + id: string; + tokens: StyleNodeTypes[]; +}; + +type Properties = WidgetJSX.LayoutProps & + WidgetJSX.GeometryProps & { + [key: string]: string | number | undefined; + + // the atuolayout props from our git repo + absolutePosition?: string; + direction?: string; + space?: string; + clippedContent?: string; + alignment?: string; + width?: string | number; + height?: string | number; + padding?: string; + opacity?: string | number; + x?: string | number; + y?: string | number; + horizontalConstraint?: string; + verticalConstraint?: string; + fill?: string; + stroke?: string; + strokeWidth?: string; + strokeAlign?: string; + cornerRadius?: string | number; + effect?: string; + }; + +type Token = { + name: string; + value: string; + from: "Local Variable" | "Token Studio"; +}; diff --git a/RadiusTokenSync/widget-src/ui/components/bottom-logo.tsx b/RadiusTokenSync/widget-src/ui/components/bottom-logo.tsx new file mode 100644 index 0000000..51a0856 --- /dev/null +++ b/RadiusTokenSync/widget-src/ui/components/bottom-logo.tsx @@ -0,0 +1,119 @@ +const { widget } = figma; + +const { Frame, AutoLayout, SVG } = widget; + +export function BottomLogo() { + return ( + + + + + + + + + + + + + ); +} diff --git a/RadiusTokenSync/widget-src/ui/components/button.tsx b/RadiusTokenSync/widget-src/ui/components/button.tsx new file mode 100644 index 0000000..ffaa29d --- /dev/null +++ b/RadiusTokenSync/widget-src/ui/components/button.tsx @@ -0,0 +1,41 @@ +import { Icon16px, IconProps } from "./icon"; + +const { widget } = figma; +const { Text, AutoLayout } = widget; + +export type ButtonProps = BaseProps & TextChildren & IconProps; + +export const Button: FunctionalWidget = ({ + children, + icon, + ...props +}) => ( + + + + {children} + + + + +); diff --git a/RadiusTokenSync/widget-src/ui/components/icon.tsx b/RadiusTokenSync/widget-src/ui/components/icon.tsx new file mode 100644 index 0000000..429fd1b --- /dev/null +++ b/RadiusTokenSync/widget-src/ui/components/icon.tsx @@ -0,0 +1,93 @@ +const { widget } = figma; +const { Frame, SVG, AutoLayout } = widget; + +type IconType = + | "add-box" + | "figma" + | "github" + | "alert" + | "check" + | "close" + | "variables" + | "tokens" + | "component" + | "instance" + | "refresh" + | "radius"; + +const iconSrc: Record = { + "add-box": ` + + `, + + figma: ` + +`, + + github: ` + + + +`, + + alert: ` + + + +`, + + check: ` + + + +`, + + close: ` + + + +`, + + variables: ` + + + + +`, + + tokens: ` + +`, + instance: ` + +`, + component: ` + +`, + refresh: ` + +`, + radius: ` + + + + +`, +}; + +export type IconProps = Partial & { + icon: IconType; + color?: string; +}; + +export function Icon16px({ icon, color = "#262626", ...props }: IconProps) { + const source = iconSrc[icon].replace(`#262626`, color); + console.log(icon, color, source); + return ( + + + + + + ); +} diff --git a/RadiusTokenSync/widget-src/ui/components/name-format.tsx b/RadiusTokenSync/widget-src/ui/components/name-format.tsx new file mode 100644 index 0000000..7eb3f6f --- /dev/null +++ b/RadiusTokenSync/widget-src/ui/components/name-format.tsx @@ -0,0 +1,122 @@ +const { widget } = figma; +const { Text, AutoLayout } = widget; + +export const NameFormat = () => { + return ( + + + format: + + + + + layer + + + + + + + subject + + + + + + + type + + + + + ); +}; diff --git a/RadiusTokenSync/widget-src/ui/components/pill.tsx b/RadiusTokenSync/widget-src/ui/components/pill.tsx new file mode 100644 index 0000000..ca93a87 --- /dev/null +++ b/RadiusTokenSync/widget-src/ui/components/pill.tsx @@ -0,0 +1,24 @@ +const { widget } = figma; +const { Text, AutoLayout } = widget; + +export type PillProps = BaseProps & TextChildren; + +export const Pill: FunctionalWidget = ({ children, ...props }) => ( + + + {children} + + +); diff --git a/RadiusTokenSync/widget-src/ui/components/widget-header.tsx b/RadiusTokenSync/widget-src/ui/components/widget-header.tsx new file mode 100644 index 0000000..704b3b5 --- /dev/null +++ b/RadiusTokenSync/widget-src/ui/components/widget-header.tsx @@ -0,0 +1,93 @@ +import { Button } from "./button"; +import { Icon16px } from "./icon"; +import { NameFormat } from "./name-format"; + +const { widget } = figma; +const { Text, AutoLayout } = widget; + +export type WidgetHeaderProps = { + loaded: boolean; + lastLoaded?: string; + remoteVersion?: string; + openConfig: () => void; + synchronize?: () => void; +}; + +export const WidgetHeader = ({ + loaded, + lastLoaded, + remoteVersion, + openConfig, + synchronize, +}: WidgetHeaderProps) => { + return ( + + + + + + Radius Token Synchronizer + + + {loaded ? ( + <> + {synchronize && ( + + )} + + ) : ( + + )} + + + + {remoteVersion && ( + <> + Remote version + {remoteVersion} + + )} + + + {lastLoaded && ( + <> + Last Synched + {lastLoaded} + + )} + + + ); +}; diff --git a/RadiusTokenSync/widget-src/ui/pages/empty-page.tsx b/RadiusTokenSync/widget-src/ui/pages/empty-page.tsx new file mode 100644 index 0000000..e254d56 --- /dev/null +++ b/RadiusTokenSync/widget-src/ui/pages/empty-page.tsx @@ -0,0 +1,39 @@ +const { widget } = figma; +const { AutoLayout, Text } = widget; + +import { WidgetHeader } from "../components/widget-header"; +import { BottomLogo } from "../components/bottom-logo"; + +type EmptyPageProps = { + openConfig: () => void; +}; + +export const EmptyPage = ({ openConfig }: EmptyPageProps) => { + return ( + + + please, configure Github to continue + + + + + ); +};