From f82d310fc96aa9a7436b327de889535fc6fd4861 Mon Sep 17 00:00:00 2001 From: softmarshmallow Date: Mon, 27 Sep 2021 14:04:16 +0900 Subject: [PATCH 001/215] init cli with flag docs & deps --- cli/README.md | 14 +++++- cli/package.json | 10 ++++ cli/tsconfig.json | 10 ++++ cli/yarn.lock | 121 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 cli/package.json create mode 100644 cli/tsconfig.json create mode 100644 cli/yarn.lock diff --git a/cli/README.md b/cli/README.md index 3d6774b8..8e52854a 100644 --- a/cli/README.md +++ b/cli/README.md @@ -1,3 +1,15 @@ # Using Design-to-code via cli -Under development. + + +## Args + +| Flags | | | | +| ------------------------- | ------------------------------- | -------------------------------------------- | ---- | +| `--framework` | specify the target framework | flutter \| react \| svelte \| vue \| vanilla | * | +| `--framework-config` | specify the framework config | framework.config.json | | +| `--design-origin` | specify the input design origin | figma \| sketch \| xd | | +| `--access-token` | access token | | | +| `--access-token-personal` | | | | +| `--design` | | | * | + diff --git a/cli/package.json b/cli/package.json new file mode 100644 index 00000000..307c5822 --- /dev/null +++ b/cli/package.json @@ -0,0 +1,10 @@ +{ + "name": "@designto/cli", + "version": "0.0.0", + "dependencies": { + "yargs": "^17.2.1" + }, + "devDependencies": { + "@types/yargs": "^17.0.3" + } +} diff --git a/cli/tsconfig.json b/cli/tsconfig.json new file mode 100644 index 00000000..8204fd8e --- /dev/null +++ b/cli/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "ES2015", + "module": "CommonJS", + "strict": false, + "esModuleInterop": true, + "moduleResolution": "node" + }, + "include": ["cli.ts"] +} diff --git a/cli/yarn.lock b/cli/yarn.lock new file mode 100644 index 00000000..b9f1b718 --- /dev/null +++ b/cli/yarn.lock @@ -0,0 +1,121 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/yargs-parser@*": + version "20.2.1" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" + integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== + +"@types/yargs@^17.0.3": + version "17.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.3.tgz#e6c552aa3277b21a8e802019d03ee5e77894cf27" + integrity sha512-K7rm3Ke3ag/pAniBe80A6J6fjoqRibvCrl3dRmtXV9eCEt9h/pZwmHX9MzjQVUc/elneQTL4Ky7XKorC71Lmxw== + dependencies: + "@types/yargs-parser" "*" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs@^17.2.1: + version "17.2.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.2.1.tgz#e2c95b9796a0e1f7f3bf4427863b42e0418191ea" + integrity sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" From ac577edff18da2469aac8627b64196568ab6eced Mon Sep 17 00:00:00 2001 From: softmarshmallow Date: Thu, 3 Mar 2022 23:04:57 +0900 Subject: [PATCH 002/215] add cli docs --- cli/README.md | 29 ++++++++++++++++++++--------- cli/contributing.md | 3 +++ 2 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 cli/contributing.md diff --git a/cli/README.md b/cli/README.md index 8e52854a..7354275b 100644 --- a/cli/README.md +++ b/cli/README.md @@ -1,15 +1,26 @@ # Using Design-to-code via cli +## Installation +``` +brew install design +``` -## Args +## Commands + +| Commands | | +| --------------- | --------------------------------------- | ---------------------------------------- | +| `design uri` | convert input uri (file or url) to code | `design https://www.figma.com/files/XXX` | +| `design help` | help | `design help` | +| `design login` | login to design services | `auto` \| `figma` \| `sketch` \| `xd` | +| `design config` | configure the preferences | -| Flags | | | | -| ------------------------- | ------------------------------- | -------------------------------------------- | ---- | -| `--framework` | specify the target framework | flutter \| react \| svelte \| vue \| vanilla | * | -| `--framework-config` | specify the framework config | framework.config.json | | -| `--design-origin` | specify the input design origin | figma \| sketch \| xd | | -| `--access-token` | access token | | | -| `--access-token-personal` | | | | -| `--design` | | | * | +## Args +| Flags | | | | +| -------------------- | ------------------------------------------------ | ------------------------------------------------------------------------ | --- | +| `--framework` | specify the target framework | `flutter` \| `react` \| `react-native` \| `svelte` \| `vue` \| `vanilla` | \* | +| `--framework-config` | specify the framework config json file | framework.config.json | | +| `--design-origin` | specify the input design origin | `auto` \| `figma` \| `sketch` \| `xd` | | +| `--access-token` | access token | | | +| `--account` | account name if signed-in with multiple accounts | diff --git a/cli/contributing.md b/cli/contributing.md new file mode 100644 index 00000000..6db84e17 --- /dev/null +++ b/cli/contributing.md @@ -0,0 +1,3 @@ +## Publishing on Brew + +- https://bharathvaj.me/blog/how-to-publish-your-nodejs-project-on-homebrew From 872f982d63e8e2b0491969cdfa0deb2eaf6818e3 Mon Sep 17 00:00:00 2001 From: "UZU, J" Date: Tue, 26 Apr 2022 13:54:38 +0900 Subject: [PATCH 003/215] add global context menu disable --- editor/pages/_app.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/editor/pages/_app.tsx b/editor/pages/_app.tsx index 0caa7db1..f407e5ab 100644 --- a/editor/pages/_app.tsx +++ b/editor/pages/_app.tsx @@ -70,7 +70,7 @@ function HeadInjection() { name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> -