@jordond/kit 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +139 -2
- package/bin/kit +39 -0
- package/dist/_verb-28xmg3d3.js +116 -0
- package/dist/android-fs3sesnn.js +60 -0
- package/dist/build-ak20h5cd.js +42 -0
- package/dist/builtins-bj2yypm6.js +10 -0
- package/dist/bump-hsfmz2rn.js +124 -0
- package/dist/certs-w5v0877b.js +76 -0
- package/dist/check-771pracn.js +33 -0
- package/dist/check-jf1apke7.js +54 -0
- package/dist/cleanup-hrcvxmh2.js +18 -0
- package/dist/cli/builtins.d.ts +13 -0
- package/dist/cli/command.d.ts +106 -0
- package/dist/cli/discover.d.ts +10 -0
- package/dist/cli/main.d.ts +1 -0
- package/dist/cli/plugin.d.ts +7 -0
- package/dist/cli/usage.d.ts +3 -0
- package/dist/cli-19me2qqg.js +1056 -0
- package/dist/cli-1htjx51v.js +80 -0
- package/dist/cli-51ha0t4k.js +70 -0
- package/dist/cli-540nme4e.js +46 -0
- package/dist/cli-5d61x8vg.js +675 -0
- package/dist/cli-5wasc5mr.js +76 -0
- package/dist/cli-699g070n.js +104 -0
- package/dist/cli-7wvrehng.js +23 -0
- package/dist/cli-cc13vv98.js +2023 -0
- package/dist/cli-dht27t4r.js +41 -0
- package/dist/cli-fqfan92n.js +135 -0
- package/dist/cli-fqxtcj42.js +75 -0
- package/dist/cli-g519ev8e.js +89 -0
- package/dist/cli-gqy1xp9t.js +97 -0
- package/dist/cli-qhs8ww91.js +51 -0
- package/dist/cli-qq1ktr8q.js +234 -0
- package/dist/cli-r6g14qrk.js +195 -0
- package/dist/cli-re3ntm60.js +48 -0
- package/dist/cli-sx073w8p.js +191 -0
- package/dist/cli-vt6582gp.js +122 -0
- package/dist/cli-xax5grx1.js +108 -0
- package/dist/cli-xjpjdc2c.js +70 -0
- package/dist/cli-y3mjprpv.js +31 -0
- package/dist/cli-zf47bkgh.js +227 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +35 -0
- package/dist/cloudflare-xf7e2dn3.js +43 -0
- package/dist/command-j1etpmj6.js +21 -0
- package/dist/commands/_verb.d.ts +15 -0
- package/dist/commands/build.d.ts +11 -0
- package/dist/commands/check.d.ts +8 -0
- package/dist/commands/completion.d.ts +15 -0
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/db/create.d.ts +7 -0
- package/dist/commands/db/exec.d.ts +16 -0
- package/dist/commands/db/list.d.ts +11 -0
- package/dist/commands/db/migrate.d.ts +11 -0
- package/dist/commands/deploy.d.ts +18 -0
- package/dist/commands/deps.d.ts +72 -0
- package/dist/commands/dev.d.ts +8 -0
- package/dist/commands/doctor.d.ts +63 -0
- package/dist/commands/env/check.d.ts +7 -0
- package/dist/commands/env/init.d.ts +2 -0
- package/dist/commands/env/push.d.ts +16 -0
- package/dist/commands/env/sync.d.ts +2 -0
- package/dist/commands/fastlane.d.ts +2 -0
- package/dist/commands/format.d.ts +11 -0
- package/dist/commands/gradle.d.ts +2 -0
- package/dist/commands/init.d.ts +70 -0
- package/dist/commands/lint.d.ts +12 -0
- package/dist/commands/release/android.d.ts +30 -0
- package/dist/commands/release/certs.d.ts +7 -0
- package/dist/commands/release/ios.d.ts +22 -0
- package/dist/commands/release/service.d.ts +6 -0
- package/dist/commands/test.d.ts +2 -0
- package/dist/commands/typecheck.d.ts +2 -0
- package/dist/commands/version/bump.d.ts +17 -0
- package/dist/commands/version/show.d.ts +2 -0
- package/dist/commands/wrangler.d.ts +2 -0
- package/dist/commands/xcode.d.ts +10 -0
- package/dist/completion-m051yvzk.js +38 -0
- package/dist/concurrent-zdz69ye5.js +96 -0
- package/dist/config/load.d.ts +6 -0
- package/dist/config/schema.d.ts +139 -0
- package/dist/config-c8yh5m9j.js +22 -0
- package/dist/create-j7ve677k.js +38 -0
- package/dist/creds-rhxhmpe6.js +22 -0
- package/dist/deploy-af2v2jhj.js +152 -0
- package/dist/deps-1apnsrre.js +334 -0
- package/dist/dev-6dv5xbv2.js +114 -0
- package/dist/doctor-cr3hcfvt.js +377 -0
- package/dist/errors-1fjbr7ee.js +10 -0
- package/dist/exec-wa94sqwn.js +53 -0
- package/dist/fastlane-2kjyfqjg.js +26 -0
- package/dist/fastlane-qsjmbxtj.js +38 -0
- package/dist/format-rehf6c8g.js +39 -0
- package/dist/git-3gyyfk0x.js +24 -0
- package/dist/gradle-wv77a2f1.js +39 -0
- package/dist/index-cx34x4np.js +874 -0
- package/dist/index-erv82p4z.js +1528 -0
- package/dist/index-jqfz6hfy.js +2659 -0
- package/dist/index-mm4ht8yh.js +9 -0
- package/dist/index-s3ehw02w.js +1610 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +55 -0
- package/dist/init-gtkmx54a.js +76 -0
- package/dist/init-kck1p6gj.js +250 -0
- package/dist/init-n38980zv.js +78 -0
- package/dist/ios-f6pwcqqt.js +50 -0
- package/dist/lib/cleanup.d.ts +21 -0
- package/dist/lib/cloudflare.d.ts +97 -0
- package/dist/lib/concurrent.d.ts +21 -0
- package/dist/lib/env/init.d.ts +22 -0
- package/dist/lib/env/load.d.ts +12 -0
- package/dist/lib/env/push.d.ts +54 -0
- package/dist/lib/env/render.d.ts +52 -0
- package/dist/lib/env/schema.d.ts +49 -0
- package/dist/lib/errors.d.ts +14 -0
- package/dist/lib/fastlane.d.ts +36 -0
- package/dist/lib/git.d.ts +36 -0
- package/dist/lib/log.d.ts +17 -0
- package/dist/lib/pm.d.ts +8 -0
- package/dist/lib/proc.d.ts +73 -0
- package/dist/lib/prompt.d.ts +32 -0
- package/dist/lib/release/creds.d.ts +26 -0
- package/dist/lib/release/mobile.d.ts +41 -0
- package/dist/lib/release/notes.d.ts +15 -0
- package/dist/lib/release/preflight.d.ts +30 -0
- package/dist/lib/release/version.d.ts +25 -0
- package/dist/lib/secrets.d.ts +32 -0
- package/dist/lib/steps.d.ts +38 -0
- package/dist/lib/targets.d.ts +46 -0
- package/dist/lib/toml.d.ts +15 -0
- package/dist/lint-e0j22mab.js +39 -0
- package/dist/list-fzwqsfsk.js +34 -0
- package/dist/load-dxhacsn4.js +137 -0
- package/dist/log-g1ebh60s.js +15 -0
- package/dist/main-jrcgdccz.js +1965 -0
- package/dist/migrate-4ncx9tqj.js +38 -0
- package/dist/mobile-9n86ytzx.js +384 -0
- package/dist/notes-1zsa7qac.js +21 -0
- package/dist/picocolors-0dxagz5d.js +6 -0
- package/dist/pm-5q5vz6w3.js +14 -0
- package/dist/proc-jv4bcyyx.js +33 -0
- package/dist/prompt-3wwegvqc.js +15 -0
- package/dist/push-acejr9gj.js +124 -0
- package/dist/push-fq5syn8c.js +117 -0
- package/dist/render-vn40fp54.js +22 -0
- package/dist/service-xekpd27p.js +102 -0
- package/dist/show-jw5bx55h.js +50 -0
- package/dist/steps-9knqpszw.js +16 -0
- package/dist/sync-9z8n875s.js +53 -0
- package/dist/targets-bywmzbtj.js +22 -0
- package/dist/test-8jws3x98.js +26 -0
- package/dist/toml-3fxsdkhr.js +14 -0
- package/dist/typecheck-1hn3hgz9.js +24 -0
- package/dist/version-4tz72w42.js +26 -0
- package/dist/wrangler-412fadcz.js +46 -0
- package/dist/xcode-qzyee632.js +75 -0
- package/fastlane/Fastfile +413 -0
- package/fastlane/Gemfile +21 -0
- package/fastlane/Gemfile.lock +275 -0
- package/gradle/maven/io/github/jordond/kit/android/application/io.github.jordond.kit.android.application.gradle.plugin/0.2.0/io.github.jordond.kit.android.application.gradle.plugin-0.2.0.pom +15 -0
- package/gradle/maven/io/github/jordond/kit/android/application/io.github.jordond.kit.android.application.gradle.plugin/0.2.0/io.github.jordond.kit.android.application.gradle.plugin-0.2.0.pom.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/application/io.github.jordond.kit.android.application.gradle.plugin/0.2.0/io.github.jordond.kit.android.application.gradle.plugin-0.2.0.pom.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/application/io.github.jordond.kit.android.application.gradle.plugin/0.2.0/io.github.jordond.kit.android.application.gradle.plugin-0.2.0.pom.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/application/io.github.jordond.kit.android.application.gradle.plugin/0.2.0/io.github.jordond.kit.android.application.gradle.plugin-0.2.0.pom.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/application/io.github.jordond.kit.android.application.gradle.plugin/maven-metadata.xml +13 -0
- package/gradle/maven/io/github/jordond/kit/android/application/io.github.jordond.kit.android.application.gradle.plugin/maven-metadata.xml.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/application/io.github.jordond.kit.android.application.gradle.plugin/maven-metadata.xml.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/application/io.github.jordond.kit.android.application.gradle.plugin/maven-metadata.xml.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/application/io.github.jordond.kit.android.application.gradle.plugin/maven-metadata.xml.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/baseline/io.github.jordond.kit.android.baseline.gradle.plugin/0.2.0/io.github.jordond.kit.android.baseline.gradle.plugin-0.2.0.pom +15 -0
- package/gradle/maven/io/github/jordond/kit/android/baseline/io.github.jordond.kit.android.baseline.gradle.plugin/0.2.0/io.github.jordond.kit.android.baseline.gradle.plugin-0.2.0.pom.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/baseline/io.github.jordond.kit.android.baseline.gradle.plugin/0.2.0/io.github.jordond.kit.android.baseline.gradle.plugin-0.2.0.pom.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/baseline/io.github.jordond.kit.android.baseline.gradle.plugin/0.2.0/io.github.jordond.kit.android.baseline.gradle.plugin-0.2.0.pom.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/baseline/io.github.jordond.kit.android.baseline.gradle.plugin/0.2.0/io.github.jordond.kit.android.baseline.gradle.plugin-0.2.0.pom.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/baseline/io.github.jordond.kit.android.baseline.gradle.plugin/maven-metadata.xml +13 -0
- package/gradle/maven/io/github/jordond/kit/android/baseline/io.github.jordond.kit.android.baseline.gradle.plugin/maven-metadata.xml.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/baseline/io.github.jordond.kit.android.baseline.gradle.plugin/maven-metadata.xml.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/baseline/io.github.jordond.kit.android.baseline.gradle.plugin/maven-metadata.xml.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/android/baseline/io.github.jordond.kit.android.baseline.gradle.plugin/maven-metadata.xml.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/compose/io.github.jordond.kit.compose.gradle.plugin/0.2.0/io.github.jordond.kit.compose.gradle.plugin-0.2.0.pom +15 -0
- package/gradle/maven/io/github/jordond/kit/compose/io.github.jordond.kit.compose.gradle.plugin/0.2.0/io.github.jordond.kit.compose.gradle.plugin-0.2.0.pom.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/compose/io.github.jordond.kit.compose.gradle.plugin/0.2.0/io.github.jordond.kit.compose.gradle.plugin-0.2.0.pom.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/compose/io.github.jordond.kit.compose.gradle.plugin/0.2.0/io.github.jordond.kit.compose.gradle.plugin-0.2.0.pom.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/compose/io.github.jordond.kit.compose.gradle.plugin/0.2.0/io.github.jordond.kit.compose.gradle.plugin-0.2.0.pom.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/compose/io.github.jordond.kit.compose.gradle.plugin/maven-metadata.xml +13 -0
- package/gradle/maven/io/github/jordond/kit/compose/io.github.jordond.kit.compose.gradle.plugin/maven-metadata.xml.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/compose/io.github.jordond.kit.compose.gradle.plugin/maven-metadata.xml.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/compose/io.github.jordond.kit.compose.gradle.plugin/maven-metadata.xml.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/compose/io.github.jordond.kit.compose.gradle.plugin/maven-metadata.xml.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/jvm/app/io.github.jordond.kit.jvm.app.gradle.plugin/0.2.0/io.github.jordond.kit.jvm.app.gradle.plugin-0.2.0.pom +15 -0
- package/gradle/maven/io/github/jordond/kit/jvm/app/io.github.jordond.kit.jvm.app.gradle.plugin/0.2.0/io.github.jordond.kit.jvm.app.gradle.plugin-0.2.0.pom.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/jvm/app/io.github.jordond.kit.jvm.app.gradle.plugin/0.2.0/io.github.jordond.kit.jvm.app.gradle.plugin-0.2.0.pom.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/jvm/app/io.github.jordond.kit.jvm.app.gradle.plugin/0.2.0/io.github.jordond.kit.jvm.app.gradle.plugin-0.2.0.pom.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/jvm/app/io.github.jordond.kit.jvm.app.gradle.plugin/0.2.0/io.github.jordond.kit.jvm.app.gradle.plugin-0.2.0.pom.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/jvm/app/io.github.jordond.kit.jvm.app.gradle.plugin/maven-metadata.xml +13 -0
- package/gradle/maven/io/github/jordond/kit/jvm/app/io.github.jordond.kit.jvm.app.gradle.plugin/maven-metadata.xml.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/jvm/app/io.github.jordond.kit.jvm.app.gradle.plugin/maven-metadata.xml.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/jvm/app/io.github.jordond.kit.jvm.app.gradle.plugin/maven-metadata.xml.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/jvm/app/io.github.jordond.kit.jvm.app.gradle.plugin/maven-metadata.xml.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.jar +0 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.jar.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.jar.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.jar.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.jar.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.module +64 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.module.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.module.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.module.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.module.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.pom +12 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.pom.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.pom.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.pom.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/0.2.0/kit-plugins-0.2.0.pom.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/maven-metadata.xml +13 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/maven-metadata.xml.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/maven-metadata.xml.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/maven-metadata.xml.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-plugins/maven-metadata.xml.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.jar +0 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.jar.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.jar.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.jar.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.jar.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.module +64 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.module.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.module.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.module.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.module.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.pom +12 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.pom.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.pom.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.pom.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/0.2.0/kit-settings-0.2.0.pom.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/maven-metadata.xml +13 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/maven-metadata.xml.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/maven-metadata.xml.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/maven-metadata.xml.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/kit-settings/maven-metadata.xml.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/kmp/library/io.github.jordond.kit.kmp.library.gradle.plugin/0.2.0/io.github.jordond.kit.kmp.library.gradle.plugin-0.2.0.pom +15 -0
- package/gradle/maven/io/github/jordond/kit/kmp/library/io.github.jordond.kit.kmp.library.gradle.plugin/0.2.0/io.github.jordond.kit.kmp.library.gradle.plugin-0.2.0.pom.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/kmp/library/io.github.jordond.kit.kmp.library.gradle.plugin/0.2.0/io.github.jordond.kit.kmp.library.gradle.plugin-0.2.0.pom.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/kmp/library/io.github.jordond.kit.kmp.library.gradle.plugin/0.2.0/io.github.jordond.kit.kmp.library.gradle.plugin-0.2.0.pom.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/kmp/library/io.github.jordond.kit.kmp.library.gradle.plugin/0.2.0/io.github.jordond.kit.kmp.library.gradle.plugin-0.2.0.pom.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/kmp/library/io.github.jordond.kit.kmp.library.gradle.plugin/maven-metadata.xml +13 -0
- package/gradle/maven/io/github/jordond/kit/kmp/library/io.github.jordond.kit.kmp.library.gradle.plugin/maven-metadata.xml.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/kmp/library/io.github.jordond.kit.kmp.library.gradle.plugin/maven-metadata.xml.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/kmp/library/io.github.jordond.kit.kmp.library.gradle.plugin/maven-metadata.xml.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/kmp/library/io.github.jordond.kit.kmp.library.gradle.plugin/maven-metadata.xml.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/lint/io.github.jordond.kit.lint.gradle.plugin/0.2.0/io.github.jordond.kit.lint.gradle.plugin-0.2.0.pom +15 -0
- package/gradle/maven/io/github/jordond/kit/lint/io.github.jordond.kit.lint.gradle.plugin/0.2.0/io.github.jordond.kit.lint.gradle.plugin-0.2.0.pom.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/lint/io.github.jordond.kit.lint.gradle.plugin/0.2.0/io.github.jordond.kit.lint.gradle.plugin-0.2.0.pom.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/lint/io.github.jordond.kit.lint.gradle.plugin/0.2.0/io.github.jordond.kit.lint.gradle.plugin-0.2.0.pom.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/lint/io.github.jordond.kit.lint.gradle.plugin/0.2.0/io.github.jordond.kit.lint.gradle.plugin-0.2.0.pom.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/lint/io.github.jordond.kit.lint.gradle.plugin/maven-metadata.xml +13 -0
- package/gradle/maven/io/github/jordond/kit/lint/io.github.jordond.kit.lint.gradle.plugin/maven-metadata.xml.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/lint/io.github.jordond.kit.lint.gradle.plugin/maven-metadata.xml.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/lint/io.github.jordond.kit.lint.gradle.plugin/maven-metadata.xml.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/lint/io.github.jordond.kit.lint.gradle.plugin/maven-metadata.xml.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/0.2.0/io.github.jordond.kit.release.gradle.plugin-0.2.0.pom +15 -0
- package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/0.2.0/io.github.jordond.kit.release.gradle.plugin-0.2.0.pom.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/0.2.0/io.github.jordond.kit.release.gradle.plugin-0.2.0.pom.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/0.2.0/io.github.jordond.kit.release.gradle.plugin-0.2.0.pom.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/0.2.0/io.github.jordond.kit.release.gradle.plugin-0.2.0.pom.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/maven-metadata.xml +13 -0
- package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/maven-metadata.xml.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/maven-metadata.xml.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/maven-metadata.xml.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/maven-metadata.xml.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/0.2.0/io.github.jordond.kit.settings.gradle.plugin-0.2.0.pom +15 -0
- package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/0.2.0/io.github.jordond.kit.settings.gradle.plugin-0.2.0.pom.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/0.2.0/io.github.jordond.kit.settings.gradle.plugin-0.2.0.pom.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/0.2.0/io.github.jordond.kit.settings.gradle.plugin-0.2.0.pom.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/0.2.0/io.github.jordond.kit.settings.gradle.plugin-0.2.0.pom.sha512 +1 -0
- package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/maven-metadata.xml +13 -0
- package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/maven-metadata.xml.md5 +1 -0
- package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/maven-metadata.xml.sha1 +1 -0
- package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/maven-metadata.xml.sha256 +1 -0
- package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/maven-metadata.xml.sha512 +1 -0
- package/package.json +58 -4
- package/templates/lefthook.yml +6 -0
- package/templates/mise.toml +6 -0
- package/templates/new/.env.example +20 -0
- package/templates/new/.github/workflows/ci.yml +45 -0
- package/templates/new/apps/client/fastlane/Fastfile +1 -0
- package/templates/new/apps/client/gradle/libs.versions.toml +25 -0
- package/templates/new/apps/client/settings.gradle.kts +25 -0
- package/templates/new/kit.config.ts +15 -0
|
@@ -0,0 +1,874 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
stringWidth
|
|
4
|
+
} from "./cli-qq1ktr8q.js";
|
|
5
|
+
import"./cli-re3ntm60.js";
|
|
6
|
+
|
|
7
|
+
// node_modules/cli-truncate/index.js
|
|
8
|
+
import { stripVTControlCharacters } from "util";
|
|
9
|
+
|
|
10
|
+
// node_modules/slice-ansi/node_modules/ansi-styles/index.js
|
|
11
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
12
|
+
var ANSI_UNDERLINE_OFFSET = 20;
|
|
13
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
14
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
15
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
16
|
+
var wrapUnderlineAnsi = (code) => `\x1B[58;5;${code < 90 ? code - 30 : code - 90 + 8}m`;
|
|
17
|
+
var blackBright = [90, 39];
|
|
18
|
+
var bgBlackBright = [100, 49];
|
|
19
|
+
var styles = {
|
|
20
|
+
modifier: {
|
|
21
|
+
reset: [0, 0],
|
|
22
|
+
bold: [1, 22],
|
|
23
|
+
dim: [2, 22],
|
|
24
|
+
italic: [3, 23],
|
|
25
|
+
underline: [4, 24],
|
|
26
|
+
underlineDouble: ["4:2", 24],
|
|
27
|
+
underlineCurly: ["4:3", 24],
|
|
28
|
+
underlineDotted: ["4:4", 24],
|
|
29
|
+
underlineDashed: ["4:5", 24],
|
|
30
|
+
overline: [53, 55],
|
|
31
|
+
inverse: [7, 27],
|
|
32
|
+
hidden: [8, 28],
|
|
33
|
+
strikethrough: [9, 29]
|
|
34
|
+
},
|
|
35
|
+
color: {
|
|
36
|
+
black: [30, 39],
|
|
37
|
+
red: [31, 39],
|
|
38
|
+
green: [32, 39],
|
|
39
|
+
yellow: [33, 39],
|
|
40
|
+
blue: [34, 39],
|
|
41
|
+
magenta: [35, 39],
|
|
42
|
+
cyan: [36, 39],
|
|
43
|
+
white: [37, 39],
|
|
44
|
+
blackBright,
|
|
45
|
+
gray: blackBright,
|
|
46
|
+
grey: blackBright,
|
|
47
|
+
redBright: [91, 39],
|
|
48
|
+
greenBright: [92, 39],
|
|
49
|
+
yellowBright: [93, 39],
|
|
50
|
+
blueBright: [94, 39],
|
|
51
|
+
magentaBright: [95, 39],
|
|
52
|
+
cyanBright: [96, 39],
|
|
53
|
+
whiteBright: [97, 39]
|
|
54
|
+
},
|
|
55
|
+
bgColor: {
|
|
56
|
+
bgBlack: [40, 49],
|
|
57
|
+
bgRed: [41, 49],
|
|
58
|
+
bgGreen: [42, 49],
|
|
59
|
+
bgYellow: [43, 49],
|
|
60
|
+
bgBlue: [44, 49],
|
|
61
|
+
bgMagenta: [45, 49],
|
|
62
|
+
bgCyan: [46, 49],
|
|
63
|
+
bgWhite: [47, 49],
|
|
64
|
+
bgBlackBright,
|
|
65
|
+
bgGray: bgBlackBright,
|
|
66
|
+
bgGrey: bgBlackBright,
|
|
67
|
+
bgRedBright: [101, 49],
|
|
68
|
+
bgGreenBright: [102, 49],
|
|
69
|
+
bgYellowBright: [103, 49],
|
|
70
|
+
bgBlueBright: [104, 49],
|
|
71
|
+
bgMagentaBright: [105, 49],
|
|
72
|
+
bgCyanBright: [106, 49],
|
|
73
|
+
bgWhiteBright: [107, 49]
|
|
74
|
+
},
|
|
75
|
+
underlineColor: {
|
|
76
|
+
underlineBlack: ["58;5;0", 59],
|
|
77
|
+
underlineRed: ["58;5;1", 59],
|
|
78
|
+
underlineGreen: ["58;5;2", 59],
|
|
79
|
+
underlineYellow: ["58;5;3", 59],
|
|
80
|
+
underlineBlue: ["58;5;4", 59],
|
|
81
|
+
underlineMagenta: ["58;5;5", 59],
|
|
82
|
+
underlineCyan: ["58;5;6", 59],
|
|
83
|
+
underlineWhite: ["58;5;7", 59],
|
|
84
|
+
underlineBlackBright: ["58;5;8", 59],
|
|
85
|
+
underlineGray: ["58;5;8", 59],
|
|
86
|
+
underlineGrey: ["58;5;8", 59],
|
|
87
|
+
underlineRedBright: ["58;5;9", 59],
|
|
88
|
+
underlineGreenBright: ["58;5;10", 59],
|
|
89
|
+
underlineYellowBright: ["58;5;11", 59],
|
|
90
|
+
underlineBlueBright: ["58;5;12", 59],
|
|
91
|
+
underlineMagentaBright: ["58;5;13", 59],
|
|
92
|
+
underlineCyanBright: ["58;5;14", 59],
|
|
93
|
+
underlineWhiteBright: ["58;5;15", 59]
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var modifierNames = Object.keys(styles.modifier);
|
|
97
|
+
var foregroundColorNames = Object.keys(styles.color);
|
|
98
|
+
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
99
|
+
var underlineColorNames = Object.keys(styles.underlineColor);
|
|
100
|
+
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
101
|
+
function assembleStyles() {
|
|
102
|
+
const codes = new Map;
|
|
103
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
104
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
105
|
+
styles[styleName] = {
|
|
106
|
+
open: `\x1B[${style[0]}m`,
|
|
107
|
+
close: `\x1B[${style[1]}m`
|
|
108
|
+
};
|
|
109
|
+
group[styleName] = styles[styleName];
|
|
110
|
+
codes.set(Number(String(style[0]).split(/[:;]/v, 1)[0]), style[1]);
|
|
111
|
+
}
|
|
112
|
+
Object.defineProperty(styles, groupName, {
|
|
113
|
+
value: group,
|
|
114
|
+
enumerable: false
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
Object.defineProperty(styles, "codes", {
|
|
118
|
+
value: codes,
|
|
119
|
+
enumerable: false
|
|
120
|
+
});
|
|
121
|
+
styles.color.close = "\x1B[39m";
|
|
122
|
+
styles.bgColor.close = "\x1B[49m";
|
|
123
|
+
styles.underlineColor.close = "\x1B[59m";
|
|
124
|
+
styles.color.ansi = wrapAnsi16();
|
|
125
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
126
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
127
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
128
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
129
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
130
|
+
styles.underlineColor.ansi = wrapUnderlineAnsi;
|
|
131
|
+
styles.underlineColor.ansi256 = wrapAnsi256(ANSI_UNDERLINE_OFFSET);
|
|
132
|
+
styles.underlineColor.ansi16m = wrapAnsi16m(ANSI_UNDERLINE_OFFSET);
|
|
133
|
+
Object.defineProperties(styles, {
|
|
134
|
+
rgbToAnsi256: {
|
|
135
|
+
value(red, green, blue) {
|
|
136
|
+
if (red === green && green === blue) {
|
|
137
|
+
if (red < 8) {
|
|
138
|
+
return 16;
|
|
139
|
+
}
|
|
140
|
+
if (red > 248) {
|
|
141
|
+
return 231;
|
|
142
|
+
}
|
|
143
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
144
|
+
}
|
|
145
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
146
|
+
},
|
|
147
|
+
enumerable: false
|
|
148
|
+
},
|
|
149
|
+
hexToRgb: {
|
|
150
|
+
value(hex) {
|
|
151
|
+
const matches = /[\da-f]{6}|[\da-f]{3}/iv.exec(hex.toString(16));
|
|
152
|
+
if (!matches) {
|
|
153
|
+
return [0, 0, 0];
|
|
154
|
+
}
|
|
155
|
+
let [colorString] = matches;
|
|
156
|
+
if (colorString.length === 3) {
|
|
157
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
158
|
+
}
|
|
159
|
+
const integer = Number.parseInt(colorString, 16);
|
|
160
|
+
return [
|
|
161
|
+
integer >> 16 & 255,
|
|
162
|
+
integer >> 8 & 255,
|
|
163
|
+
integer & 255
|
|
164
|
+
];
|
|
165
|
+
},
|
|
166
|
+
enumerable: false
|
|
167
|
+
},
|
|
168
|
+
hexToAnsi256: {
|
|
169
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
170
|
+
enumerable: false
|
|
171
|
+
},
|
|
172
|
+
ansi256ToAnsi: {
|
|
173
|
+
value(code) {
|
|
174
|
+
if (code < 8) {
|
|
175
|
+
return 30 + code;
|
|
176
|
+
}
|
|
177
|
+
if (code < 16) {
|
|
178
|
+
return 90 + (code - 8);
|
|
179
|
+
}
|
|
180
|
+
let red;
|
|
181
|
+
let green;
|
|
182
|
+
let blue;
|
|
183
|
+
if (code >= 232) {
|
|
184
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
185
|
+
green = red;
|
|
186
|
+
blue = red;
|
|
187
|
+
} else {
|
|
188
|
+
code -= 16;
|
|
189
|
+
const remainder = code % 36;
|
|
190
|
+
red = Math.floor(code / 36) / 5;
|
|
191
|
+
green = Math.floor(remainder / 6) / 5;
|
|
192
|
+
blue = remainder % 6 / 5;
|
|
193
|
+
}
|
|
194
|
+
const value = Math.max(red, green, blue) * 2;
|
|
195
|
+
if (value === 0) {
|
|
196
|
+
return 30;
|
|
197
|
+
}
|
|
198
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
199
|
+
if (value === 2) {
|
|
200
|
+
result += 60;
|
|
201
|
+
}
|
|
202
|
+
return result;
|
|
203
|
+
},
|
|
204
|
+
enumerable: false
|
|
205
|
+
},
|
|
206
|
+
rgbToAnsi: {
|
|
207
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
208
|
+
enumerable: false
|
|
209
|
+
},
|
|
210
|
+
hexToAnsi: {
|
|
211
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
212
|
+
enumerable: false
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
return styles;
|
|
216
|
+
}
|
|
217
|
+
var ansiStyles = assembleStyles();
|
|
218
|
+
var ansi_styles_default = ansiStyles;
|
|
219
|
+
|
|
220
|
+
// node_modules/slice-ansi/tokenize-ansi.js
|
|
221
|
+
var ESCAPE_CODE_POINT = 27;
|
|
222
|
+
var C1_DCS_CODE_POINT = 144;
|
|
223
|
+
var C1_SOS_CODE_POINT = 152;
|
|
224
|
+
var C1_CSI_CODE_POINT = 155;
|
|
225
|
+
var C1_ST_CODE_POINT = 156;
|
|
226
|
+
var C1_OSC_CODE_POINT = 157;
|
|
227
|
+
var C1_PM_CODE_POINT = 158;
|
|
228
|
+
var C1_APC_CODE_POINT = 159;
|
|
229
|
+
var CONTROL_STRING_STARTS = new Set([
|
|
230
|
+
C1_DCS_CODE_POINT,
|
|
231
|
+
C1_SOS_CODE_POINT,
|
|
232
|
+
C1_OSC_CODE_POINT,
|
|
233
|
+
C1_PM_CODE_POINT,
|
|
234
|
+
C1_APC_CODE_POINT
|
|
235
|
+
]);
|
|
236
|
+
var ESCAPES = new Set([
|
|
237
|
+
ESCAPE_CODE_POINT,
|
|
238
|
+
C1_CSI_CODE_POINT,
|
|
239
|
+
C1_ST_CODE_POINT,
|
|
240
|
+
...CONTROL_STRING_STARTS
|
|
241
|
+
]);
|
|
242
|
+
var ESCAPE = "\x1B";
|
|
243
|
+
var ANSI_BELL = "\x07";
|
|
244
|
+
var ANSI_CSI = "[";
|
|
245
|
+
var ANSI_OSC = "]";
|
|
246
|
+
var ANSI_SGR_TERMINATOR = "m";
|
|
247
|
+
var ANSI_OSC_TERMINATOR = "\\";
|
|
248
|
+
var ANSI_STRING_TERMINATOR = `${ESCAPE}${ANSI_OSC_TERMINATOR}`;
|
|
249
|
+
var C1_OSC = "\x9D";
|
|
250
|
+
var C1_STRING_TERMINATOR = "\x9C";
|
|
251
|
+
var ANSI_HYPERLINK_ESC_PREFIX = `${ESCAPE}${ANSI_OSC}8;`;
|
|
252
|
+
var ANSI_HYPERLINK_C1_PREFIX = `${C1_OSC}8;`;
|
|
253
|
+
var CODE_POINT_CSI_PARAMETER_START = "0".codePointAt(0);
|
|
254
|
+
var CODE_POINT_CSI_PARAMETER_END = "?".codePointAt(0);
|
|
255
|
+
var CODE_POINT_CSI_INTERMEDIATE_START = " ".codePointAt(0);
|
|
256
|
+
var CODE_POINT_CSI_INTERMEDIATE_END = "/".codePointAt(0);
|
|
257
|
+
var CODE_POINT_CSI_FINAL_START = "@".codePointAt(0);
|
|
258
|
+
var CODE_POINT_CSI_FINAL_END = "~".codePointAt(0);
|
|
259
|
+
var SGR_RESET_CODE = 0;
|
|
260
|
+
var SGR_EXTENDED_COLOR_END_CODES = new Map([
|
|
261
|
+
[38, 39],
|
|
262
|
+
[48, 49],
|
|
263
|
+
[58, 59]
|
|
264
|
+
]);
|
|
265
|
+
var SGR_COLOR_LENGTHS = new Map([
|
|
266
|
+
[5, 3],
|
|
267
|
+
[2, 5]
|
|
268
|
+
]);
|
|
269
|
+
var GRAPHEME_SEGMENTER = new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
270
|
+
var endCodeNumbers = new Set;
|
|
271
|
+
for (const [, end] of ansi_styles_default.codes) {
|
|
272
|
+
endCodeNumbers.add(end);
|
|
273
|
+
}
|
|
274
|
+
function isCsiParameterCharacter(codePoint) {
|
|
275
|
+
return codePoint >= CODE_POINT_CSI_PARAMETER_START && codePoint <= CODE_POINT_CSI_PARAMETER_END;
|
|
276
|
+
}
|
|
277
|
+
function isCsiIntermediateCharacter(codePoint) {
|
|
278
|
+
return codePoint >= CODE_POINT_CSI_INTERMEDIATE_START && codePoint <= CODE_POINT_CSI_INTERMEDIATE_END;
|
|
279
|
+
}
|
|
280
|
+
function isCsiFinalCharacter(codePoint) {
|
|
281
|
+
return codePoint >= CODE_POINT_CSI_FINAL_START && codePoint <= CODE_POINT_CSI_FINAL_END;
|
|
282
|
+
}
|
|
283
|
+
function createControlParseResult(code, endIndex) {
|
|
284
|
+
return {
|
|
285
|
+
token: {
|
|
286
|
+
type: "control",
|
|
287
|
+
code
|
|
288
|
+
},
|
|
289
|
+
endIndex
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
function getSgrPrefix(code) {
|
|
293
|
+
return code.startsWith("\x9B") ? "\x9B" : `${ESCAPE}${ANSI_CSI}`;
|
|
294
|
+
}
|
|
295
|
+
function createSgrCode(prefix, values) {
|
|
296
|
+
return `${prefix}${values.join(";")}${ANSI_SGR_TERMINATOR}`;
|
|
297
|
+
}
|
|
298
|
+
function getSgrFragments(code) {
|
|
299
|
+
const fragments = [];
|
|
300
|
+
const sgrPrefix = getSgrPrefix(code);
|
|
301
|
+
const rawCodes = code.slice(sgrPrefix.length, -1).split(";");
|
|
302
|
+
let index = 0;
|
|
303
|
+
while (index < rawCodes.length) {
|
|
304
|
+
const codeNumber = Number.parseInt(rawCodes[index] || "0", 10);
|
|
305
|
+
if (Number.isNaN(codeNumber)) {
|
|
306
|
+
index++;
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
if (codeNumber === SGR_RESET_CODE) {
|
|
310
|
+
fragments.push({ type: "reset" });
|
|
311
|
+
index++;
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
if (endCodeNumbers.has(codeNumber)) {
|
|
315
|
+
fragments.push({
|
|
316
|
+
type: "end",
|
|
317
|
+
endCode: ansi_styles_default.color.ansi(codeNumber)
|
|
318
|
+
});
|
|
319
|
+
index++;
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
const extendedColorEndCode = SGR_EXTENDED_COLOR_END_CODES.get(codeNumber);
|
|
323
|
+
let fragmentLength = 1;
|
|
324
|
+
if (extendedColorEndCode !== undefined && !rawCodes[index].includes(":")) {
|
|
325
|
+
const colorType = Number.parseInt(rawCodes[index + 1], 10);
|
|
326
|
+
const colorLength = SGR_COLOR_LENGTHS.get(colorType);
|
|
327
|
+
if (colorLength !== undefined && index + colorLength <= rawCodes.length) {
|
|
328
|
+
fragmentLength = colorLength;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
const endCode = extendedColorEndCode ?? ansi_styles_default.codes.get(codeNumber);
|
|
332
|
+
fragments.push({
|
|
333
|
+
type: "start",
|
|
334
|
+
code: createSgrCode(sgrPrefix, rawCodes.slice(index, index + fragmentLength)),
|
|
335
|
+
endCode: endCode === undefined ? ansi_styles_default.reset.open : ansi_styles_default.color.ansi(endCode)
|
|
336
|
+
});
|
|
337
|
+
index += fragmentLength;
|
|
338
|
+
}
|
|
339
|
+
if (fragments.length === 0) {
|
|
340
|
+
fragments.push({ type: "reset" });
|
|
341
|
+
}
|
|
342
|
+
return fragments;
|
|
343
|
+
}
|
|
344
|
+
function parseCsiCode(string, index) {
|
|
345
|
+
const escapeCodePoint = string.codePointAt(index);
|
|
346
|
+
let sequenceStartIndex;
|
|
347
|
+
if (escapeCodePoint === ESCAPE_CODE_POINT) {
|
|
348
|
+
if (string[index + 1] !== ANSI_CSI) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
sequenceStartIndex = index + 2;
|
|
352
|
+
} else if (escapeCodePoint === C1_CSI_CODE_POINT) {
|
|
353
|
+
sequenceStartIndex = index + 1;
|
|
354
|
+
} else {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
for (let sequenceIndex = sequenceStartIndex;sequenceIndex < string.length; sequenceIndex++) {
|
|
358
|
+
const codePoint = string.codePointAt(sequenceIndex);
|
|
359
|
+
if (isCsiFinalCharacter(codePoint)) {
|
|
360
|
+
const code = string.slice(index, sequenceIndex + 1);
|
|
361
|
+
if (string[sequenceIndex] !== ANSI_SGR_TERMINATOR || !/^[\d:;]*$/v.test(string.slice(sequenceStartIndex, sequenceIndex))) {
|
|
362
|
+
return createControlParseResult(code, sequenceIndex + 1);
|
|
363
|
+
}
|
|
364
|
+
return {
|
|
365
|
+
token: {
|
|
366
|
+
type: "sgr",
|
|
367
|
+
code,
|
|
368
|
+
fragments: getSgrFragments(code)
|
|
369
|
+
},
|
|
370
|
+
endIndex: sequenceIndex + 1
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
if (isCsiParameterCharacter(codePoint) || isCsiIntermediateCharacter(codePoint)) {
|
|
374
|
+
continue;
|
|
375
|
+
}
|
|
376
|
+
const endIndex = sequenceIndex;
|
|
377
|
+
return createControlParseResult(string.slice(index, endIndex), endIndex);
|
|
378
|
+
}
|
|
379
|
+
return createControlParseResult(string.slice(index), string.length);
|
|
380
|
+
}
|
|
381
|
+
function createControlStringParseResult(string, index, endIndex, terminator) {
|
|
382
|
+
const code = string.slice(index, endIndex);
|
|
383
|
+
const hyperlinkPrefix = code.startsWith(ANSI_HYPERLINK_ESC_PREFIX) ? ANSI_HYPERLINK_ESC_PREFIX : ANSI_HYPERLINK_C1_PREFIX;
|
|
384
|
+
if (!code.startsWith(hyperlinkPrefix)) {
|
|
385
|
+
return createControlParseResult(code, endIndex);
|
|
386
|
+
}
|
|
387
|
+
const uriStart = code.indexOf(";", hyperlinkPrefix.length);
|
|
388
|
+
const contentEnd = code.length - terminator.length;
|
|
389
|
+
if (uriStart === -1 || uriStart >= contentEnd) {
|
|
390
|
+
return createControlParseResult(code, endIndex);
|
|
391
|
+
}
|
|
392
|
+
return {
|
|
393
|
+
token: {
|
|
394
|
+
type: "hyperlink",
|
|
395
|
+
code,
|
|
396
|
+
action: uriStart + 1 === contentEnd ? "close" : "open",
|
|
397
|
+
closePrefix: `${hyperlinkPrefix};`,
|
|
398
|
+
terminator
|
|
399
|
+
},
|
|
400
|
+
endIndex
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
function parseControlStringCode(string, index) {
|
|
404
|
+
const codePoint = string.codePointAt(index);
|
|
405
|
+
const command = codePoint === ESCAPE_CODE_POINT ? string.codePointAt(index + 1) + 64 : codePoint;
|
|
406
|
+
const sequenceStartIndex = index + (codePoint === ESCAPE_CODE_POINT ? 2 : 1);
|
|
407
|
+
if (command === C1_ST_CODE_POINT) {
|
|
408
|
+
return createControlParseResult(string.slice(index, sequenceStartIndex), sequenceStartIndex);
|
|
409
|
+
}
|
|
410
|
+
if (!CONTROL_STRING_STARTS.has(command)) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
for (let sequenceIndex = sequenceStartIndex;sequenceIndex < string.length; sequenceIndex++) {
|
|
414
|
+
if (command === C1_OSC_CODE_POINT && string[sequenceIndex] === ANSI_BELL) {
|
|
415
|
+
return createControlStringParseResult(string, index, sequenceIndex + 1, ANSI_BELL);
|
|
416
|
+
}
|
|
417
|
+
if (string[sequenceIndex] === ESCAPE && string[sequenceIndex + 1] === ANSI_OSC_TERMINATOR) {
|
|
418
|
+
return createControlStringParseResult(string, index, sequenceIndex + 2, ANSI_STRING_TERMINATOR);
|
|
419
|
+
}
|
|
420
|
+
if (string[sequenceIndex] === C1_STRING_TERMINATOR) {
|
|
421
|
+
return createControlStringParseResult(string, index, sequenceIndex + 1, C1_STRING_TERMINATOR);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return createControlParseResult(string.slice(index), string.length);
|
|
425
|
+
}
|
|
426
|
+
function parseAnsiCode(string, index) {
|
|
427
|
+
return parseControlStringCode(string, index) || parseCsiCode(string, index);
|
|
428
|
+
}
|
|
429
|
+
function appendAnsiTokens(string, index, tokens) {
|
|
430
|
+
while (index < string.length) {
|
|
431
|
+
const nextCodePoint = string.codePointAt(index);
|
|
432
|
+
if (!ESCAPES.has(nextCodePoint)) {
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
const escapeCode = parseAnsiCode(string, index);
|
|
436
|
+
if (!escapeCode) {
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
tokens.push(escapeCode.token);
|
|
440
|
+
index = escapeCode.endIndex;
|
|
441
|
+
}
|
|
442
|
+
return index;
|
|
443
|
+
}
|
|
444
|
+
function parseCharacterTokenWithRawSegmentation(index, graphemeSegments) {
|
|
445
|
+
const segment = graphemeSegments.containing(index);
|
|
446
|
+
if (!segment || segment.index !== index) {
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
return {
|
|
450
|
+
token: {
|
|
451
|
+
type: "character",
|
|
452
|
+
value: segment.segment,
|
|
453
|
+
visibleWidth: stringWidth(segment.segment)
|
|
454
|
+
},
|
|
455
|
+
endIndex: index + segment.segment.length
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
function tokenizeAnsiWithVisibleSegmentation(string, { endCharacter = Infinity } = {}) {
|
|
459
|
+
const tokens = [];
|
|
460
|
+
let visibleString = "";
|
|
461
|
+
let index = 0;
|
|
462
|
+
while (index < string.length) {
|
|
463
|
+
const codePoint = string.codePointAt(index);
|
|
464
|
+
if (ESCAPES.has(codePoint)) {
|
|
465
|
+
const code = parseAnsiCode(string, index);
|
|
466
|
+
if (code) {
|
|
467
|
+
tokens.push(code.token);
|
|
468
|
+
index = code.endIndex;
|
|
469
|
+
continue;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
const value = String.fromCodePoint(codePoint);
|
|
473
|
+
visibleString += value;
|
|
474
|
+
tokens.push({ type: "text", value, visibleEnd: visibleString.length });
|
|
475
|
+
index += value.length;
|
|
476
|
+
}
|
|
477
|
+
const graphemes = [];
|
|
478
|
+
let tokenIndex = 0;
|
|
479
|
+
let visibleCount = 0;
|
|
480
|
+
for (const { segment, index: segmentIndex } of GRAPHEME_SEGMENTER.segment(visibleString)) {
|
|
481
|
+
while (tokens[tokenIndex].type !== "text") {
|
|
482
|
+
graphemes.push(tokens[tokenIndex]);
|
|
483
|
+
tokenIndex++;
|
|
484
|
+
}
|
|
485
|
+
if (segmentIndex > 0 && visibleCount >= endCharacter) {
|
|
486
|
+
return graphemes;
|
|
487
|
+
}
|
|
488
|
+
const startIndex = tokenIndex;
|
|
489
|
+
const visibleEnd = segmentIndex + segment.length;
|
|
490
|
+
do {
|
|
491
|
+
tokenIndex++;
|
|
492
|
+
} while (tokens[tokenIndex - 1].visibleEnd !== visibleEnd);
|
|
493
|
+
const visibleWidth = stringWidth(segment);
|
|
494
|
+
graphemes.push({
|
|
495
|
+
type: "character",
|
|
496
|
+
value: segment,
|
|
497
|
+
visibleWidth,
|
|
498
|
+
parts: tokens.slice(startIndex, tokenIndex)
|
|
499
|
+
});
|
|
500
|
+
visibleCount += visibleWidth;
|
|
501
|
+
}
|
|
502
|
+
while (tokenIndex < tokens.length) {
|
|
503
|
+
graphemes.push(tokens[tokenIndex]);
|
|
504
|
+
tokenIndex++;
|
|
505
|
+
}
|
|
506
|
+
return graphemes;
|
|
507
|
+
}
|
|
508
|
+
function areValuesInSameGrapheme(leftValue, rightValue) {
|
|
509
|
+
const segment = GRAPHEME_SEGMENTER.segment(leftValue + rightValue).containing(leftValue.length);
|
|
510
|
+
return segment.index < leftValue.length;
|
|
511
|
+
}
|
|
512
|
+
function tokenizeAnsi(string, { endCharacter = Infinity } = {}) {
|
|
513
|
+
const tokens = [];
|
|
514
|
+
const graphemeSegments = GRAPHEME_SEGMENTER.segment(string);
|
|
515
|
+
let index = 0;
|
|
516
|
+
let visibleCount = 0;
|
|
517
|
+
let previousCharacter;
|
|
518
|
+
while (index < string.length) {
|
|
519
|
+
index = appendAnsiTokens(string, index, tokens);
|
|
520
|
+
if (index === string.length) {
|
|
521
|
+
break;
|
|
522
|
+
}
|
|
523
|
+
const characterToken = parseCharacterTokenWithRawSegmentation(index, graphemeSegments);
|
|
524
|
+
if (!characterToken || previousCharacter && index > previousCharacter.endIndex && areValuesInSameGrapheme(previousCharacter.token.value, characterToken.token.value)) {
|
|
525
|
+
return tokenizeAnsiWithVisibleSegmentation(string, { endCharacter });
|
|
526
|
+
}
|
|
527
|
+
if (previousCharacter && visibleCount >= endCharacter) {
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
tokens.push(characterToken.token);
|
|
531
|
+
index = characterToken.endIndex;
|
|
532
|
+
visibleCount += characterToken.token.visibleWidth;
|
|
533
|
+
previousCharacter = characterToken;
|
|
534
|
+
}
|
|
535
|
+
return tokens;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
// node_modules/slice-ansi/index.js
|
|
539
|
+
class SliceOutput {
|
|
540
|
+
#phase = "before";
|
|
541
|
+
#styles = new Map;
|
|
542
|
+
#hyperlink;
|
|
543
|
+
#checkpoint;
|
|
544
|
+
#output = [];
|
|
545
|
+
#writeText(value) {
|
|
546
|
+
if (this.#phase === "before") {
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
this.#output.push(value);
|
|
550
|
+
this.#checkpoint = undefined;
|
|
551
|
+
if (this.#hyperlink?.phase === "pending") {
|
|
552
|
+
this.#hyperlink = { phase: "visible", token: this.#hyperlink.token };
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
#writeSgr(token, isPastEnd) {
|
|
556
|
+
const hasStart = token.fragments.some((fragment) => fragment.type === "start");
|
|
557
|
+
if (isPastEnd) {
|
|
558
|
+
const hasClosingEffect = token.fragments.some(({ type, endCode }) => type === "reset" && this.#styles.size > 0 || type === "end" && this.#styles.has(endCode));
|
|
559
|
+
if (hasStart || !hasClosingEffect) {
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
if (hasStart && !this.#checkpoint && this.#phase === "emitting") {
|
|
564
|
+
this.#checkpoint = { outputLength: this.#output.length, styles: new Map(this.#styles), hyperlink: this.#hyperlink };
|
|
565
|
+
}
|
|
566
|
+
this.#applySgrFragments(token.fragments);
|
|
567
|
+
if (this.#phase === "emitting") {
|
|
568
|
+
this.#output.push(token.code);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
#applySgrFragments(fragments) {
|
|
572
|
+
for (const fragment of fragments) {
|
|
573
|
+
switch (fragment.type) {
|
|
574
|
+
case "reset": {
|
|
575
|
+
this.#styles.clear();
|
|
576
|
+
break;
|
|
577
|
+
}
|
|
578
|
+
case "end": {
|
|
579
|
+
this.#styles.delete(fragment.endCode);
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
582
|
+
case "start": {
|
|
583
|
+
this.#styles.delete(fragment.endCode);
|
|
584
|
+
this.#styles.set(fragment.endCode, fragment.code);
|
|
585
|
+
break;
|
|
586
|
+
}
|
|
587
|
+
default: {
|
|
588
|
+
break;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
#openHyperlink(token) {
|
|
594
|
+
if (this.#phase === "before") {
|
|
595
|
+
this.#hyperlink = { phase: "inherited", token };
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
this.#hyperlink = { phase: "pending", token, outputIndex: this.#output.length };
|
|
599
|
+
this.#output.push(token.code);
|
|
600
|
+
}
|
|
601
|
+
#settleHyperlink() {
|
|
602
|
+
const hyperlink = this.#hyperlink;
|
|
603
|
+
if (!hyperlink) {
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
if (hyperlink.phase === "visible") {
|
|
607
|
+
this.#output.push(`${hyperlink.token.closePrefix}${hyperlink.token.terminator}`);
|
|
608
|
+
} else if (hyperlink.phase === "pending") {
|
|
609
|
+
this.#output[hyperlink.outputIndex] = "";
|
|
610
|
+
}
|
|
611
|
+
this.#hyperlink = undefined;
|
|
612
|
+
}
|
|
613
|
+
#writeHyperlink(token, isPastEnd) {
|
|
614
|
+
if (isPastEnd && (token.action !== "close" || !this.#hyperlink)) {
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
if (token.action === "open") {
|
|
618
|
+
this.#settleHyperlink();
|
|
619
|
+
this.#openHyperlink(token);
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
if (this.#hyperlink?.phase === "pending") {
|
|
623
|
+
this.#settleHyperlink();
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
this.#hyperlink = undefined;
|
|
627
|
+
if (this.#phase === "emitting") {
|
|
628
|
+
this.#output.push(token.code);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
begin() {
|
|
632
|
+
if (this.#phase === "emitting") {
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
this.#phase = "emitting";
|
|
636
|
+
this.#output.push(...this.#styles.values());
|
|
637
|
+
if (this.#hyperlink) {
|
|
638
|
+
this.#openHyperlink(this.#hyperlink.token);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
write(token, isPastEnd = false) {
|
|
642
|
+
switch (token.type) {
|
|
643
|
+
case "sgr": {
|
|
644
|
+
this.#writeSgr(token, isPastEnd);
|
|
645
|
+
break;
|
|
646
|
+
}
|
|
647
|
+
case "hyperlink": {
|
|
648
|
+
this.#writeHyperlink(token, isPastEnd);
|
|
649
|
+
break;
|
|
650
|
+
}
|
|
651
|
+
case "control": {
|
|
652
|
+
if (!isPastEnd && this.#phase === "emitting") {
|
|
653
|
+
this.#output.push(token.code);
|
|
654
|
+
}
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
657
|
+
case "text": {
|
|
658
|
+
this.#writeText(token.value);
|
|
659
|
+
break;
|
|
660
|
+
}
|
|
661
|
+
case "character": {
|
|
662
|
+
if (token.parts) {
|
|
663
|
+
for (const part of token.parts) {
|
|
664
|
+
this.write(part);
|
|
665
|
+
}
|
|
666
|
+
} else {
|
|
667
|
+
this.#writeText(token.value);
|
|
668
|
+
}
|
|
669
|
+
break;
|
|
670
|
+
}
|
|
671
|
+
default: {
|
|
672
|
+
break;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
discardPending() {
|
|
677
|
+
if (this.#hyperlink?.phase !== "visible") {
|
|
678
|
+
this.#settleHyperlink();
|
|
679
|
+
}
|
|
680
|
+
if (!this.#checkpoint) {
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
this.#output.length = this.#checkpoint.outputLength;
|
|
684
|
+
this.#styles = this.#checkpoint.styles;
|
|
685
|
+
this.#hyperlink = this.#checkpoint.hyperlink;
|
|
686
|
+
this.#checkpoint = undefined;
|
|
687
|
+
}
|
|
688
|
+
finish() {
|
|
689
|
+
if (this.#phase === "before") {
|
|
690
|
+
return "";
|
|
691
|
+
}
|
|
692
|
+
this.#settleHyperlink();
|
|
693
|
+
this.#output.push(...[...this.#styles.keys()].toReversed());
|
|
694
|
+
return this.#output.join("");
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
function sliceAnsi(string, start, end) {
|
|
698
|
+
if (end <= start || string.length === 0) {
|
|
699
|
+
return "";
|
|
700
|
+
}
|
|
701
|
+
const output = new SliceOutput;
|
|
702
|
+
let position = 0;
|
|
703
|
+
for (const token of tokenizeAnsi(string, { endCharacter: end })) {
|
|
704
|
+
const isPastEnd = end !== undefined && position >= end;
|
|
705
|
+
if (token.type === "character") {
|
|
706
|
+
if (isPastEnd || end !== undefined && position + token.visibleWidth > end) {
|
|
707
|
+
output.discardPending();
|
|
708
|
+
break;
|
|
709
|
+
}
|
|
710
|
+
if (position >= start) {
|
|
711
|
+
output.begin();
|
|
712
|
+
}
|
|
713
|
+
output.write(token);
|
|
714
|
+
position += token.visibleWidth;
|
|
715
|
+
} else {
|
|
716
|
+
output.write(token, isPastEnd);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
return output.finish();
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
// node_modules/cli-truncate/index.js
|
|
723
|
+
var validPositions = new Set(["start", "middle", "end"]);
|
|
724
|
+
function getVisibleColumns(text) {
|
|
725
|
+
const visibleColumns = [];
|
|
726
|
+
for (const { segment } of new Intl.Segmenter().segment(stripVTControlCharacters(text))) {
|
|
727
|
+
const width = stringWidth(segment);
|
|
728
|
+
for (let column = 0;column < width; column++) {
|
|
729
|
+
visibleColumns.push(column === 0 ? segment : "");
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
return visibleColumns;
|
|
733
|
+
}
|
|
734
|
+
function getIndexOfNearestSpace(visibleColumns, wantedIndex, shouldSearchRight) {
|
|
735
|
+
if (visibleColumns[wantedIndex] === " ") {
|
|
736
|
+
return wantedIndex;
|
|
737
|
+
}
|
|
738
|
+
const direction = shouldSearchRight ? 1 : -1;
|
|
739
|
+
for (let index = 0;index <= 3; index++) {
|
|
740
|
+
const finalIndex = wantedIndex + index * direction;
|
|
741
|
+
if (visibleColumns[finalIndex] === " ") {
|
|
742
|
+
return finalIndex;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
return wantedIndex;
|
|
746
|
+
}
|
|
747
|
+
function getIndexAfterSpaces(visibleColumns, index) {
|
|
748
|
+
while (visibleColumns[index] === " ") {
|
|
749
|
+
index++;
|
|
750
|
+
}
|
|
751
|
+
return index;
|
|
752
|
+
}
|
|
753
|
+
function validateInput(text, columns, position, truncationCharacter) {
|
|
754
|
+
if (typeof text !== "string") {
|
|
755
|
+
throw new TypeError(`Expected \`input\` to be a string, got ${typeof text}`);
|
|
756
|
+
}
|
|
757
|
+
if (typeof columns !== "number") {
|
|
758
|
+
throw new TypeError(`Expected \`columns\` to be a number, got ${typeof columns}`);
|
|
759
|
+
}
|
|
760
|
+
if (!Number.isFinite(columns)) {
|
|
761
|
+
throw new TypeError(`Expected \`columns\` to be a finite number, got ${columns}`);
|
|
762
|
+
}
|
|
763
|
+
if (!validPositions.has(position)) {
|
|
764
|
+
throw new TypeError(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`);
|
|
765
|
+
}
|
|
766
|
+
if (typeof truncationCharacter !== "string") {
|
|
767
|
+
throw new TypeError(`Expected \`options.truncationCharacter\` to be a string, got ${typeof truncationCharacter}`);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
function cliTruncate(text, columns, options = {}) {
|
|
771
|
+
const {
|
|
772
|
+
position = "end",
|
|
773
|
+
space = false,
|
|
774
|
+
preferTruncationOnSpace = false
|
|
775
|
+
} = options;
|
|
776
|
+
let { truncationCharacter = "\u2026" } = options;
|
|
777
|
+
validateInput(text, columns, position, truncationCharacter);
|
|
778
|
+
if (columns < 1) {
|
|
779
|
+
return "";
|
|
780
|
+
}
|
|
781
|
+
const length = stringWidth(text);
|
|
782
|
+
if (length <= columns) {
|
|
783
|
+
return text;
|
|
784
|
+
}
|
|
785
|
+
if (columns === 1) {
|
|
786
|
+
return truncationCharacter;
|
|
787
|
+
}
|
|
788
|
+
const visibleColumns = preferTruncationOnSpace ? getVisibleColumns(text) : undefined;
|
|
789
|
+
const ANSI = {
|
|
790
|
+
ESC: 27,
|
|
791
|
+
LEFT_BRACKET: 91,
|
|
792
|
+
LETTER_M: 109
|
|
793
|
+
};
|
|
794
|
+
const isSgrParameter = (code) => code >= 48 && code <= 57 || code === 59;
|
|
795
|
+
function leadingSgrSpanEndIndex(string) {
|
|
796
|
+
let index = 0;
|
|
797
|
+
while (index + 2 < string.length && string.codePointAt(index) === ANSI.ESC && string.codePointAt(index + 1) === ANSI.LEFT_BRACKET) {
|
|
798
|
+
let j = index + 2;
|
|
799
|
+
while (j < string.length && isSgrParameter(string.codePointAt(j))) {
|
|
800
|
+
j++;
|
|
801
|
+
}
|
|
802
|
+
if (j < string.length && string.codePointAt(j) === ANSI.LETTER_M) {
|
|
803
|
+
index = j + 1;
|
|
804
|
+
continue;
|
|
805
|
+
}
|
|
806
|
+
break;
|
|
807
|
+
}
|
|
808
|
+
return index;
|
|
809
|
+
}
|
|
810
|
+
function trailingSgrSpanStartIndex(string) {
|
|
811
|
+
let start = string.length;
|
|
812
|
+
while (start > 1 && string.codePointAt(start - 1) === ANSI.LETTER_M) {
|
|
813
|
+
let j = start - 2;
|
|
814
|
+
while (j >= 0 && isSgrParameter(string.codePointAt(j))) {
|
|
815
|
+
j--;
|
|
816
|
+
}
|
|
817
|
+
if (j >= 1 && string.codePointAt(j - 1) === ANSI.ESC && string.codePointAt(j) === ANSI.LEFT_BRACKET) {
|
|
818
|
+
start = j - 1;
|
|
819
|
+
continue;
|
|
820
|
+
}
|
|
821
|
+
break;
|
|
822
|
+
}
|
|
823
|
+
return start;
|
|
824
|
+
}
|
|
825
|
+
function appendWithInheritedStyleFromEnd(visible, suffix) {
|
|
826
|
+
const start = trailingSgrSpanStartIndex(visible);
|
|
827
|
+
return start === visible.length ? visible + suffix : visible.slice(0, start) + suffix + visible.slice(start);
|
|
828
|
+
}
|
|
829
|
+
function prependWithInheritedStyleFromStart(prefix, visible) {
|
|
830
|
+
const end = leadingSgrSpanEndIndex(visible);
|
|
831
|
+
return end === 0 ? prefix + visible : visible.slice(0, end) + prefix + visible.slice(end);
|
|
832
|
+
}
|
|
833
|
+
if (position === "start") {
|
|
834
|
+
if (preferTruncationOnSpace) {
|
|
835
|
+
const nearestSpace = getIndexOfNearestSpace(visibleColumns, length - columns + stringWidth(truncationCharacter), true);
|
|
836
|
+
const right2 = sliceAnsi(text, getIndexAfterSpaces(visibleColumns, nearestSpace), length);
|
|
837
|
+
return prependWithInheritedStyleFromStart(truncationCharacter, right2);
|
|
838
|
+
}
|
|
839
|
+
if (space) {
|
|
840
|
+
truncationCharacter += " ";
|
|
841
|
+
}
|
|
842
|
+
const right = sliceAnsi(text, length - columns + stringWidth(truncationCharacter), length);
|
|
843
|
+
return prependWithInheritedStyleFromStart(truncationCharacter, right);
|
|
844
|
+
}
|
|
845
|
+
if (position === "middle") {
|
|
846
|
+
if (space) {
|
|
847
|
+
truncationCharacter = ` ${truncationCharacter} `;
|
|
848
|
+
if (stringWidth(truncationCharacter) >= columns) {
|
|
849
|
+
truncationCharacter = truncationCharacter.trim();
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
const truncationWidth = stringWidth(truncationCharacter);
|
|
853
|
+
const half = Math.min(Math.floor(columns / 2), Math.max(0, columns - truncationWidth));
|
|
854
|
+
if (preferTruncationOnSpace) {
|
|
855
|
+
const spaceNearFirstBreakPoint = getIndexOfNearestSpace(visibleColumns, half);
|
|
856
|
+
const spaceNearSecondBreakPoint = getIndexOfNearestSpace(visibleColumns, length - (columns - half) + truncationWidth, true);
|
|
857
|
+
return sliceAnsi(text, 0, spaceNearFirstBreakPoint) + truncationCharacter + sliceAnsi(text, getIndexAfterSpaces(visibleColumns, spaceNearSecondBreakPoint), length);
|
|
858
|
+
}
|
|
859
|
+
return sliceAnsi(text, 0, half) + truncationCharacter + sliceAnsi(text, length - (columns - half) + truncationWidth, length);
|
|
860
|
+
}
|
|
861
|
+
if (preferTruncationOnSpace) {
|
|
862
|
+
const nearestSpace = getIndexOfNearestSpace(visibleColumns, columns - stringWidth(truncationCharacter));
|
|
863
|
+
const left2 = sliceAnsi(text, 0, nearestSpace);
|
|
864
|
+
return appendWithInheritedStyleFromEnd(left2, truncationCharacter);
|
|
865
|
+
}
|
|
866
|
+
if (space) {
|
|
867
|
+
truncationCharacter = ` ${truncationCharacter}`;
|
|
868
|
+
}
|
|
869
|
+
const left = sliceAnsi(text, 0, columns - stringWidth(truncationCharacter));
|
|
870
|
+
return appendWithInheritedStyleFromEnd(left, truncationCharacter);
|
|
871
|
+
}
|
|
872
|
+
export {
|
|
873
|
+
cliTruncate as default
|
|
874
|
+
};
|