@gluhar/cli 3.0.2 → 6.0.0-next.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/package.json +53 -46
- package/src/GlobalOptions.d.ts +8 -0
- package/src/GlobalOptions.d.ts.map +1 -0
- package/src/GlobalOptions.js +2 -0
- package/src/commands/blank/BlankOptions.d.ts +4 -0
- package/src/commands/blank/BlankOptions.d.ts.map +1 -0
- package/src/commands/blank/BlankOptions.js +2 -0
- package/src/commands/blank/blank.d.ts +3 -0
- package/src/commands/blank/blank.d.ts.map +1 -0
- package/src/commands/blank/blank.js +8 -0
- package/src/commands/blank/index.d.ts +4 -0
- package/src/commands/blank/index.d.ts.map +1 -0
- package/src/commands/blank/index.js +9 -0
- package/src/commands/blank/log.d.ts +2 -0
- package/src/commands/blank/log.d.ts.map +1 -0
- package/src/commands/blank/log.js +5 -0
- package/src/commands/build/BuildOptions.d.ts +4 -0
- package/src/commands/build/BuildOptions.d.ts.map +1 -0
- package/src/commands/build/BuildOptions.js +2 -0
- package/src/commands/build/build.d.ts +3 -0
- package/src/commands/build/build.d.ts.map +1 -0
- package/src/commands/build/build.js +22 -0
- package/src/commands/build/index.d.ts +4 -0
- package/src/commands/build/index.d.ts.map +1 -0
- package/src/commands/build/index.js +9 -0
- package/src/commands/build/log.d.ts +2 -0
- package/src/commands/build/log.d.ts.map +1 -0
- package/src/commands/build/log.js +5 -0
- package/src/commands/danka/DankaOptions.d.ts +4 -0
- package/src/commands/danka/DankaOptions.d.ts.map +1 -0
- package/src/commands/danka/DankaOptions.js +2 -0
- package/src/commands/danka/danka.d.ts +3 -0
- package/src/commands/danka/danka.d.ts.map +1 -0
- package/src/commands/danka/danka.js +8 -0
- package/src/commands/danka/index.d.ts +4 -0
- package/src/commands/danka/index.d.ts.map +1 -0
- package/src/commands/danka/index.js +9 -0
- package/src/commands/danka/log.d.ts +2 -0
- package/src/commands/danka/log.d.ts.map +1 -0
- package/src/commands/danka/log.js +5 -0
- package/src/commands/deinstall/DeinstallOptions.d.ts +4 -0
- package/src/commands/deinstall/DeinstallOptions.d.ts.map +1 -0
- package/src/commands/deinstall/DeinstallOptions.js +2 -0
- package/src/commands/deinstall/deinstall.d.ts +3 -0
- package/src/commands/deinstall/deinstall.d.ts.map +1 -0
- package/src/commands/deinstall/deinstall.js +21 -0
- package/src/commands/deinstall/index.d.ts +4 -0
- package/src/commands/deinstall/index.d.ts.map +1 -0
- package/src/commands/deinstall/index.js +9 -0
- package/src/commands/deinstall/log.d.ts +2 -0
- package/src/commands/deinstall/log.d.ts.map +1 -0
- package/src/commands/deinstall/log.js +5 -0
- package/src/commands/deploy/DeployOptions.d.ts +7 -0
- package/src/commands/deploy/DeployOptions.d.ts.map +1 -0
- package/src/commands/deploy/DeployOptions.js +2 -0
- package/src/commands/deploy/deploy.d.ts +3 -0
- package/src/commands/deploy/deploy.d.ts.map +1 -0
- package/src/commands/deploy/deploy.js +33 -0
- package/src/commands/deploy/deployIos.d.ts +2 -0
- package/src/commands/deploy/deployIos.d.ts.map +1 -0
- package/src/commands/deploy/deployIos.js +44 -0
- package/src/commands/deploy/index.d.ts +4 -0
- package/src/commands/deploy/index.d.ts.map +1 -0
- package/src/commands/deploy/index.js +12 -0
- package/src/commands/deploy/log.d.ts +2 -0
- package/src/commands/deploy/log.d.ts.map +1 -0
- package/src/commands/deploy/log.js +5 -0
- package/src/commands/deploy/setSsr.d.ts +2 -0
- package/src/commands/deploy/setSsr.d.ts.map +1 -0
- package/src/commands/deploy/setSsr.js +25 -0
- package/src/commands/dev/DevOptions.d.ts +5 -0
- package/src/commands/dev/DevOptions.d.ts.map +1 -0
- package/src/commands/dev/DevOptions.js +2 -0
- package/src/commands/dev/dev.d.ts +3 -0
- package/src/commands/dev/dev.d.ts.map +1 -0
- package/src/commands/dev/dev.js +16 -0
- package/src/commands/dev/devIos.d.ts +3 -0
- package/src/commands/dev/devIos.d.ts.map +1 -0
- package/src/commands/dev/devIos.js +26 -0
- package/src/commands/dev/index.d.ts +4 -0
- package/src/commands/dev/index.d.ts.map +1 -0
- package/src/commands/dev/index.js +10 -0
- package/src/commands/dev/log.d.ts +2 -0
- package/src/commands/dev/log.d.ts.map +1 -0
- package/src/commands/dev/log.js +5 -0
- package/src/commands/generate/GenerateOptions.d.ts +9 -0
- package/src/commands/generate/GenerateOptions.d.ts.map +1 -0
- package/src/commands/generate/GenerateOptions.js +4 -0
- package/src/commands/generate/generate.d.ts +3 -0
- package/src/commands/generate/generate.d.ts.map +1 -0
- package/src/commands/generate/generate.js +22 -0
- package/src/commands/generate/generateCommand.d.ts +2 -0
- package/src/commands/generate/generateCommand.d.ts.map +1 -0
- package/src/commands/generate/generateCommand.js +36 -0
- package/src/commands/generate/generateProject.d.ts +3 -0
- package/src/commands/generate/generateProject.d.ts.map +1 -0
- package/src/commands/generate/generateProject.js +86 -0
- package/src/commands/generate/index.d.ts +4 -0
- package/src/commands/generate/index.d.ts.map +1 -0
- package/src/commands/generate/index.js +14 -0
- package/src/commands/generate/log.d.ts +2 -0
- package/src/commands/generate/log.d.ts.map +1 -0
- package/src/commands/generate/log.js +5 -0
- package/src/commands/index.d.ts +3 -0
- package/src/commands/index.d.ts.map +1 -0
- package/src/commands/index.js +25 -0
- package/src/commands/kiss/KissOptions.d.ts +4 -0
- package/src/commands/kiss/KissOptions.d.ts.map +1 -0
- package/src/commands/kiss/KissOptions.js +2 -0
- package/src/commands/kiss/index.d.ts +4 -0
- package/src/commands/kiss/index.d.ts.map +1 -0
- package/src/commands/kiss/index.js +9 -0
- package/src/commands/kiss/kiss.d.ts +3 -0
- package/src/commands/kiss/kiss.d.ts.map +1 -0
- package/src/commands/kiss/kiss.js +8 -0
- package/src/commands/kiss/log.d.ts +2 -0
- package/src/commands/kiss/log.d.ts.map +1 -0
- package/src/commands/kiss/log.js +5 -0
- package/src/commands/reinstall/ReinstallOptions.d.ts +4 -0
- package/src/commands/reinstall/ReinstallOptions.d.ts.map +1 -0
- package/src/commands/reinstall/ReinstallOptions.js +2 -0
- package/src/commands/reinstall/index.d.ts +4 -0
- package/src/commands/reinstall/index.d.ts.map +1 -0
- package/src/commands/reinstall/index.js +9 -0
- package/src/commands/reinstall/log.d.ts +2 -0
- package/src/commands/reinstall/log.d.ts.map +1 -0
- package/src/commands/reinstall/log.js +5 -0
- package/src/commands/reinstall/reinstall.d.ts +3 -0
- package/src/commands/reinstall/reinstall.d.ts.map +1 -0
- package/src/commands/reinstall/reinstall.js +14 -0
- package/src/commands/release/ReleaseOptions.d.ts +10 -0
- package/src/commands/release/ReleaseOptions.d.ts.map +1 -0
- package/src/commands/release/ReleaseOptions.js +2 -0
- package/src/commands/release/index.d.ts +4 -0
- package/src/commands/release/index.d.ts.map +1 -0
- package/src/commands/release/index.js +26 -0
- package/src/commands/release/log.d.ts +2 -0
- package/src/commands/release/log.d.ts.map +1 -0
- package/src/commands/release/log.js +5 -0
- package/src/commands/release/publish.d.ts +3 -0
- package/src/commands/release/publish.d.ts.map +1 -0
- package/src/commands/release/publish.js +20 -0
- package/src/commands/release/release.d.ts +3 -0
- package/src/commands/release/release.d.ts.map +1 -0
- package/src/commands/release/release.js +31 -0
- package/src/commands/release/tag.d.ts +23 -0
- package/src/commands/release/tag.d.ts.map +1 -0
- package/src/commands/release/tag.js +93 -0
- package/src/commands/upgrade/UpgradeOptions.d.ts +5 -0
- package/src/commands/upgrade/UpgradeOptions.d.ts.map +1 -0
- package/src/commands/upgrade/UpgradeOptions.js +2 -0
- package/src/commands/upgrade/index.d.ts +4 -0
- package/src/commands/upgrade/index.d.ts.map +1 -0
- package/src/commands/upgrade/index.js +9 -0
- package/src/commands/upgrade/log.d.ts +2 -0
- package/src/commands/upgrade/log.d.ts.map +1 -0
- package/src/commands/upgrade/log.js +5 -0
- package/src/commands/upgrade/upgrade.d.ts +3 -0
- package/src/commands/upgrade/upgrade.d.ts.map +1 -0
- package/src/commands/upgrade/upgrade.js +22 -0
- package/src/commands/version/VersionOptions.d.ts +8 -0
- package/src/commands/version/VersionOptions.d.ts.map +1 -0
- package/src/commands/version/VersionOptions.js +2 -0
- package/src/commands/version/getPreid.d.ts +2 -0
- package/src/commands/version/getPreid.d.ts.map +1 -0
- package/src/commands/version/getPreid.js +10 -0
- package/src/commands/version/index.d.ts +4 -0
- package/src/commands/version/index.d.ts.map +1 -0
- package/src/commands/version/index.js +12 -0
- package/src/commands/version/log.d.ts +2 -0
- package/src/commands/version/log.d.ts.map +1 -0
- package/src/commands/version/log.js +5 -0
- package/src/commands/version/pimpChangelogs.d.ts +2 -0
- package/src/commands/version/pimpChangelogs.d.ts.map +1 -0
- package/src/commands/version/pimpChangelogs.js +37 -0
- package/src/commands/version/version.d.ts +3 -0
- package/src/commands/version/version.d.ts.map +1 -0
- package/src/commands/version/version.js +35 -0
- package/src/constants.d.ts +4 -0
- package/src/constants.d.ts.map +1 -0
- package/src/constants.js +7 -0
- package/src/index.d.ts +3 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +24 -0
- package/src/preAction.d.ts +3 -0
- package/src/preAction.d.ts.map +1 -0
- package/src/preAction.js +82 -0
- package/src/scripts/cmd/cd.d.ts +2 -0
- package/src/scripts/cmd/cd.d.ts.map +1 -0
- package/src/scripts/cmd/cd.js +15 -0
- package/src/scripts/cmd/{executeBash.ts → executeBash.d.ts} +10 -20
- package/src/scripts/cmd/executeBash.d.ts.map +1 -0
- package/src/scripts/cmd/executeBash.js +21 -0
- package/src/scripts/cmd/executeCmd.d.ts +9 -0
- package/src/scripts/cmd/executeCmd.d.ts.map +1 -0
- package/src/scripts/cmd/executeCmd.js +23 -0
- package/src/scripts/cmd/exitOnFailure.d.ts +8 -0
- package/src/scripts/cmd/exitOnFailure.d.ts.map +1 -0
- package/src/scripts/cmd/exitOnFailure.js +20 -0
- package/src/scripts/cmd/{getBashOutput.ts → getBashOutput.d.ts} +10 -23
- package/src/scripts/cmd/getBashOutput.d.ts.map +1 -0
- package/src/scripts/cmd/getBashOutput.js +19 -0
- package/src/scripts/cmd/getCmdOutput.d.ts +10 -0
- package/src/scripts/cmd/getCmdOutput.d.ts.map +1 -0
- package/src/scripts/cmd/getCmdOutput.js +26 -0
- package/src/scripts/cmd/{index.ts → index.d.ts} +9 -10
- package/src/scripts/cmd/index.d.ts.map +1 -0
- package/src/scripts/cmd/index.js +26 -0
- package/src/scripts/cmd/log.d.ts +2 -0
- package/src/scripts/cmd/log.d.ts.map +1 -0
- package/src/scripts/cmd/log.js +5 -0
- package/src/scripts/cmd/parseArgs.d.ts +3 -0
- package/src/scripts/cmd/parseArgs.d.ts.map +1 -0
- package/src/scripts/cmd/parseArgs.js +41 -0
- package/src/scripts/cmd/parseBashArgs.d.ts +3 -0
- package/src/scripts/cmd/parseBashArgs.d.ts.map +1 -0
- package/src/scripts/cmd/parseBashArgs.js +16 -0
- package/src/scripts/cmd/types.d.ts +12 -0
- package/src/scripts/cmd/types.d.ts.map +1 -0
- package/src/scripts/cmd/types.js +2 -0
- package/src/scripts/filesystem/copyDir.d.ts +9 -0
- package/src/scripts/filesystem/copyDir.d.ts.map +1 -0
- package/src/scripts/filesystem/copyDir.js +26 -0
- package/src/scripts/filesystem/copyFiles.d.ts +11 -0
- package/src/scripts/filesystem/copyFiles.d.ts.map +1 -0
- package/src/scripts/filesystem/copyFiles.js +59 -0
- package/src/scripts/filesystem/findFile.d.ts +2 -0
- package/src/scripts/filesystem/findFile.d.ts.map +1 -0
- package/src/scripts/filesystem/findFile.js +24 -0
- package/src/scripts/filesystem/index.d.ts +10 -0
- package/src/scripts/filesystem/index.d.ts.map +1 -0
- package/src/scripts/filesystem/index.js +17 -0
- package/src/scripts/filesystem/loadJsonFile.d.ts +2 -0
- package/src/scripts/filesystem/loadJsonFile.d.ts.map +1 -0
- package/src/scripts/filesystem/loadJsonFile.js +18 -0
- package/src/scripts/filesystem/log.d.ts +2 -0
- package/src/scripts/filesystem/log.d.ts.map +1 -0
- package/src/scripts/filesystem/log.js +5 -0
- package/src/scripts/filesystem/readDirRecursive.d.ts +2 -0
- package/src/scripts/filesystem/readDirRecursive.d.ts.map +1 -0
- package/src/scripts/filesystem/readDirRecursive.js +16 -0
- package/src/scripts/git/branch/branchDelete.d.ts +6 -0
- package/src/scripts/git/branch/branchDelete.d.ts.map +1 -0
- package/src/scripts/git/branch/branchDelete.js +24 -0
- package/src/scripts/git/branch/branchExists.d.ts +5 -0
- package/src/scripts/git/branch/branchExists.d.ts.map +1 -0
- package/src/scripts/git/branch/branchExists.js +15 -0
- package/src/scripts/git/branch/checkout.d.ts +5 -0
- package/src/scripts/git/branch/checkout.d.ts.map +1 -0
- package/src/scripts/git/branch/checkout.js +15 -0
- package/src/scripts/git/branch/getCurrentBranch.d.ts +11 -0
- package/src/scripts/git/branch/getCurrentBranch.d.ts.map +1 -0
- package/src/scripts/git/branch/getCurrentBranch.js +28 -0
- package/src/scripts/git/clone.d.ts +10 -0
- package/src/scripts/git/clone.d.ts.map +1 -0
- package/src/scripts/git/clone.js +14 -0
- package/src/scripts/git/commit.sh +0 -0
- package/src/scripts/git/getRepo.d.ts +2 -0
- package/src/scripts/git/getRepo.d.ts.map +1 -0
- package/src/scripts/git/getRepo.js +13 -0
- package/src/scripts/git/index.d.ts +29 -0
- package/src/scripts/git/index.d.ts.map +1 -0
- package/src/scripts/git/index.js +40 -0
- package/src/scripts/git/log.d.ts +2 -0
- package/src/scripts/git/log.d.ts.map +1 -0
- package/src/scripts/git/log.js +5 -0
- package/src/scripts/git/openPr.d.ts +2 -0
- package/src/scripts/git/openPr.d.ts.map +1 -0
- package/src/scripts/git/openPr.js +20 -0
- package/src/scripts/git/remoteStatus.d.ts +3 -0
- package/src/scripts/git/remoteStatus.d.ts.map +1 -0
- package/src/scripts/git/remoteStatus.js +22 -0
- package/src/scripts/git/tag/createTag.d.ts +18 -0
- package/src/scripts/git/tag/createTag.d.ts.map +1 -0
- package/src/scripts/git/tag/createTag.js +18 -0
- package/src/scripts/git/tag/deleteTag.d.ts +2 -0
- package/src/scripts/git/tag/deleteTag.d.ts.map +1 -0
- package/src/scripts/git/tag/deleteTag.js +13 -0
- package/src/scripts/git/tag/getTags.d.ts +2 -0
- package/src/scripts/git/tag/getTags.d.ts.map +1 -0
- package/src/scripts/git/tag/getTags.js +8 -0
- package/src/scripts/git/tag/pushAllTags.d.ts +2 -0
- package/src/scripts/git/tag/pushAllTags.d.ts.map +1 -0
- package/src/scripts/git/tag/pushAllTags.js +8 -0
- package/src/scripts/git/tag/renameTag.d.ts +2 -0
- package/src/scripts/git/tag/renameTag.d.ts.map +1 -0
- package/src/scripts/git/tag/renameTag.js +14 -0
- package/src/scripts/lerna/changed.d.ts +3 -0
- package/src/scripts/lerna/changed.d.ts.map +1 -0
- package/src/scripts/lerna/changed.js +13 -0
- package/src/scripts/lerna/constants.d.ts +5 -0
- package/src/scripts/lerna/constants.d.ts.map +1 -0
- package/src/scripts/lerna/constants.js +7 -0
- package/src/scripts/lerna/filterByDependency.d.ts +7 -0
- package/src/scripts/lerna/filterByDependency.d.ts.map +1 -0
- package/src/scripts/lerna/filterByDependency.js +18 -0
- package/src/scripts/lerna/getConfig.d.ts +3 -0
- package/src/scripts/lerna/getConfig.d.ts.map +1 -0
- package/src/scripts/lerna/getConfig.js +13 -0
- package/src/scripts/lerna/getDependencies.d.ts +9 -0
- package/src/scripts/lerna/getDependencies.d.ts.map +1 -0
- package/src/scripts/lerna/getDependencies.js +23 -0
- package/src/scripts/lerna/getDetails.d.ts +3 -0
- package/src/scripts/lerna/getDetails.d.ts.map +1 -0
- package/src/scripts/lerna/getDetails.js +38 -0
- package/src/scripts/lerna/index.d.ts +14 -0
- package/src/scripts/lerna/index.d.ts.map +1 -0
- package/src/scripts/lerna/index.js +19 -0
- package/src/scripts/lerna/log.d.ts +2 -0
- package/src/scripts/lerna/log.d.ts.map +1 -0
- package/src/scripts/lerna/log.js +5 -0
- package/src/scripts/lerna/publish.sh +0 -0
- package/src/scripts/lerna/types.d.ts +62 -0
- package/src/scripts/lerna/types.d.ts.map +1 -0
- package/src/scripts/lerna/types.js +2 -0
- package/src/scripts/lerna/version.sh +1 -1
- package/src/utils/chalk.d.ts +4 -0
- package/src/utils/chalk.d.ts.map +1 -0
- package/src/utils/chalk.js +9 -0
- package/src/utils/common.d.ts +8 -0
- package/src/utils/common.d.ts.map +1 -0
- package/src/utils/common.js +21 -0
- package/src/utils/{index.ts → index.d.ts} +4 -3
- package/src/utils/index.d.ts.map +1 -0
- package/src/utils/index.js +19 -0
- package/src/utils/inquirer.d.ts +5 -0
- package/src/utils/inquirer.d.ts.map +1 -0
- package/src/utils/inquirer.js +21 -0
- package/src/utils/logger.d.ts +9 -0
- package/src/utils/logger.d.ts.map +1 -0
- package/src/utils/logger.js +36 -0
- package/CHANGELOG.md +0 -628
- package/README.md +0 -11
- package/src/GlobalOptions.ts +0 -8
- package/src/commands/blank/BlankOptions.ts +0 -3
- package/src/commands/blank/blank.ts +0 -6
- package/src/commands/blank/index.ts +0 -8
- package/src/commands/blank/log.ts +0 -3
- package/src/commands/build/BuildOptions.ts +0 -3
- package/src/commands/build/build.ts +0 -24
- package/src/commands/build/index.ts +0 -8
- package/src/commands/build/log.ts +0 -3
- package/src/commands/deinstall/DeinstallOptions.ts +0 -3
- package/src/commands/deinstall/deinstall.ts +0 -19
- package/src/commands/deinstall/index.ts +0 -11
- package/src/commands/deinstall/log.ts +0 -3
- package/src/commands/deploy/DeployOptions.ts +0 -6
- package/src/commands/deploy/deploy.ts +0 -39
- package/src/commands/deploy/deployIos.ts +0 -48
- package/src/commands/deploy/index.ts +0 -20
- package/src/commands/deploy/log.ts +0 -3
- package/src/commands/deploy/setSsr.ts +0 -25
- package/src/commands/dev/DevOptions.ts +0 -4
- package/src/commands/dev/dev.ts +0 -15
- package/src/commands/dev/devIos.ts +0 -23
- package/src/commands/dev/index.ts +0 -12
- package/src/commands/dev/log.ts +0 -3
- package/src/commands/generate/GenerateOptions.ts +0 -9
- package/src/commands/generate/generate.ts +0 -29
- package/src/commands/generate/generateCommand.ts +0 -46
- package/src/commands/generate/generateProject.ts +0 -115
- package/src/commands/generate/index.ts +0 -19
- package/src/commands/generate/log.ts +0 -3
- package/src/commands/index.ts +0 -21
- package/src/commands/reinstall/ReinstallOptions.ts +0 -3
- package/src/commands/reinstall/index.ts +0 -11
- package/src/commands/reinstall/log.ts +0 -3
- package/src/commands/reinstall/reinstall.ts +0 -13
- package/src/commands/release/ReleaseOptions.ts +0 -8
- package/src/commands/release/index.ts +0 -40
- package/src/commands/release/log.ts +0 -3
- package/src/commands/release/publish.ts +0 -18
- package/src/commands/release/release.ts +0 -24
- package/src/commands/release/tag.ts +0 -119
- package/src/commands/upgrade/UpgradeOptions.ts +0 -3
- package/src/commands/upgrade/index.ts +0 -10
- package/src/commands/upgrade/log.ts +0 -3
- package/src/commands/upgrade/upgrade.ts +0 -10
- package/src/commands/version/VersionOptions.ts +0 -7
- package/src/commands/version/getPreid.ts +0 -7
- package/src/commands/version/index.ts +0 -18
- package/src/commands/version/log.ts +0 -3
- package/src/commands/version/pimpChangelogs.ts +0 -43
- package/src/commands/version/version.ts +0 -33
- package/src/constants.ts +0 -5
- package/src/index.ts +0 -24
- package/src/preAction.ts +0 -93
- package/src/scripts/cmd/cd.ts +0 -9
- package/src/scripts/cmd/executeCmd.ts +0 -23
- package/src/scripts/cmd/getCmdOutput.ts +0 -26
- package/src/scripts/cmd/log.ts +0 -3
- package/src/scripts/cmd/parseArgs.ts +0 -44
- package/src/scripts/cmd/parseBashArgs.ts +0 -21
- package/src/scripts/cmd/types.ts +0 -13
- package/src/scripts/filesystem/copyDir.ts +0 -29
- package/src/scripts/filesystem/copyFiles.ts +0 -75
- package/src/scripts/filesystem/findFile.ts +0 -29
- package/src/scripts/filesystem/index.ts +0 -15
- package/src/scripts/filesystem/loadJsonFile.ts +0 -17
- package/src/scripts/filesystem/log.ts +0 -3
- package/src/scripts/filesystem/readDirRecursive.ts +0 -21
- package/src/scripts/git/branch/branchDelete.ts +0 -32
- package/src/scripts/git/branch/branchExists.ts +0 -14
- package/src/scripts/git/branch/checkout.ts +0 -19
- package/src/scripts/git/branch/getCurrentBranch.ts +0 -37
- package/src/scripts/git/clone.ts +0 -20
- package/src/scripts/git/getRepo.ts +0 -11
- package/src/scripts/git/index.ts +0 -44
- package/src/scripts/git/log.ts +0 -3
- package/src/scripts/git/openPr.ts +0 -21
- package/src/scripts/git/remoteStatus.ts +0 -28
- package/src/scripts/git/tag/createTag.ts +0 -28
- package/src/scripts/git/tag/deleteTag.ts +0 -11
- package/src/scripts/git/tag/getTags.ts +0 -6
- package/src/scripts/git/tag/pushAllTags.ts +0 -6
- package/src/scripts/git/tag/renameTag.ts +0 -12
- package/src/scripts/lerna/changed.ts +0 -11
- package/src/scripts/lerna/constants.ts +0 -6
- package/src/scripts/lerna/filterByDependency.ts +0 -21
- package/src/scripts/lerna/getConfig.ts +0 -12
- package/src/scripts/lerna/getDependencies.ts +0 -25
- package/src/scripts/lerna/getDetails.ts +0 -44
- package/src/scripts/lerna/index.ts +0 -18
- package/src/scripts/lerna/log.ts +0 -3
- package/src/scripts/lerna/types.ts +0 -64
- package/src/utils/chalk.ts +0 -4
- package/src/utils/common.ts +0 -16
- package/src/utils/inquirer.ts +0 -20
- package/src/utils/logger.ts +0 -51
- package/tsconfig.json +0 -28
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { version } from "../version/version";
|
|
2
|
-
import type { ReleaseOptions } from "./ReleaseOptions";
|
|
3
|
-
import { log } from "./log";
|
|
4
|
-
import { publish } from "./publish";
|
|
5
|
-
import { tag } from "./tag";
|
|
6
|
-
|
|
7
|
-
export const release = async (options: ReleaseOptions) => {
|
|
8
|
-
log.info("Initiating release...");
|
|
9
|
-
const { pre, dev, yes } = options;
|
|
10
|
-
if (yes) log.info("and saying yes to all prompts.");
|
|
11
|
-
|
|
12
|
-
if (options.version)
|
|
13
|
-
await version({
|
|
14
|
-
pre,
|
|
15
|
-
dev,
|
|
16
|
-
yes,
|
|
17
|
-
changelog: !dev,
|
|
18
|
-
commit: "chore: Releasing gluhar packages.",
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
publish(options);
|
|
22
|
-
|
|
23
|
-
await tag(options);
|
|
24
|
-
};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { lerna } from "src/scripts/lerna";
|
|
2
|
-
import { INDEPENDENT_VERSION } from "src/scripts/lerna/constants";
|
|
3
|
-
import { git } from "src/scripts/git";
|
|
4
|
-
import { confirmQuestion } from "src/utils";
|
|
5
|
-
import type { ReleaseOptions } from "./ReleaseOptions";
|
|
6
|
-
import { log } from "./log";
|
|
7
|
-
|
|
8
|
-
export const pattern = {
|
|
9
|
-
/** e.g. `@gluhar/cli` */
|
|
10
|
-
fullPackageName: "%f",
|
|
11
|
-
/** e.g. `cli` */
|
|
12
|
-
shortPackageName: "%s",
|
|
13
|
-
/** e.g. `1.2.3` */
|
|
14
|
-
version: "%v",
|
|
15
|
-
default: {
|
|
16
|
-
/** e.g. `cli/v1.2.3` */
|
|
17
|
-
independent: "%f@%v",
|
|
18
|
-
/** e.g. `v1.2.3` */
|
|
19
|
-
fixed: "v%v",
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const getGitTagPattern = (
|
|
24
|
-
gitTag: ReleaseOptions["gitTag"],
|
|
25
|
-
isIndependent: boolean
|
|
26
|
-
) => {
|
|
27
|
-
if (typeof gitTag === "string") {
|
|
28
|
-
return gitTag;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (!gitTag) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return isIndependent ? pattern.default.independent : pattern.default.fixed;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export interface PackageInfo {
|
|
39
|
-
/** Required for independent versioning. */
|
|
40
|
-
name?: string;
|
|
41
|
-
version: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export const parsePattern = (tagPattern: string, pkg: PackageInfo): string => {
|
|
45
|
-
const { name: fullName, version } = pkg;
|
|
46
|
-
const placeholders: { pattern: string; value: string }[] = [
|
|
47
|
-
{
|
|
48
|
-
pattern: pattern.version,
|
|
49
|
-
value: version,
|
|
50
|
-
},
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
if (fullName) {
|
|
54
|
-
const shortName = fullName.substring(fullName.indexOf("/") + 1);
|
|
55
|
-
placeholders.push({
|
|
56
|
-
pattern: pattern.fullPackageName,
|
|
57
|
-
value: fullName,
|
|
58
|
-
});
|
|
59
|
-
placeholders.push({
|
|
60
|
-
pattern: pattern.shortPackageName,
|
|
61
|
-
value: shortName,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return placeholders.reduce(
|
|
66
|
-
(t, ph) => t.replaceAll(ph.pattern, ph.value),
|
|
67
|
-
tagPattern
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const tag = async (options: ReleaseOptions) => {
|
|
72
|
-
const { gitTag, yes } = options;
|
|
73
|
-
if (!gitTag) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const lernaConfig = lerna.getConfig();
|
|
78
|
-
const isIndependent =
|
|
79
|
-
!!lernaConfig && lernaConfig.version === INDEPENDENT_VERSION;
|
|
80
|
-
|
|
81
|
-
const tagPattern = getGitTagPattern(gitTag, isIndependent);
|
|
82
|
-
if (!tagPattern) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const tags = new Set<string>();
|
|
87
|
-
|
|
88
|
-
if (
|
|
89
|
-
!lernaConfig ||
|
|
90
|
-
isIndependent ||
|
|
91
|
-
tagPattern.includes(pattern.fullPackageName) ||
|
|
92
|
-
tagPattern.includes(pattern.shortPackageName)
|
|
93
|
-
) {
|
|
94
|
-
lerna
|
|
95
|
-
.changed()
|
|
96
|
-
.filter((pkg) => !pkg.private)
|
|
97
|
-
.map((pkg) => parsePattern(tagPattern, pkg))
|
|
98
|
-
.forEach((t) => tags.add(t));
|
|
99
|
-
} else {
|
|
100
|
-
const t = parsePattern(tagPattern, { version: lernaConfig.version });
|
|
101
|
-
tags.add(t);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const tagList = [...tags].map((t) => `\n - ${t}`).join("");
|
|
105
|
-
log.verbose("Tags to create:", tagList);
|
|
106
|
-
|
|
107
|
-
const confirm = await confirmQuestion(
|
|
108
|
-
`Create and push tag(s): ${tagList}. Confirm?`,
|
|
109
|
-
yes
|
|
110
|
-
);
|
|
111
|
-
|
|
112
|
-
if (confirm) {
|
|
113
|
-
tags.forEach((t) => {
|
|
114
|
-
git.tag.create(t);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
git.tag.pushAll();
|
|
118
|
-
}
|
|
119
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
import { upgrade } from "./upgrade";
|
|
3
|
-
|
|
4
|
-
export default new Command()
|
|
5
|
-
.name("upgrade")
|
|
6
|
-
.description(
|
|
7
|
-
"Upgrade all gluhar dependencies in a project to their latest versions."
|
|
8
|
-
)
|
|
9
|
-
.option("-b, --upgrade", "A boolean option.")
|
|
10
|
-
.action(upgrade);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { executeCmd } from "src/scripts/cmd";
|
|
2
|
-
import { UpgradeOptions } from "./UpgradeOptions";
|
|
3
|
-
import { log } from "./log";
|
|
4
|
-
|
|
5
|
-
export const upgrade = (options: UpgradeOptions) => {
|
|
6
|
-
log.info("Upgrading gluhar dependencies.");
|
|
7
|
-
|
|
8
|
-
// Upgrade all gluhar dependencies in a project to their latest versions.
|
|
9
|
-
executeCmd("npm update @gluhar/cli @gluhar/app");
|
|
10
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
import { version } from "./version";
|
|
3
|
-
|
|
4
|
-
export default new Command()
|
|
5
|
-
.name("version")
|
|
6
|
-
.description("Update package versions and generate change logs.")
|
|
7
|
-
.option(
|
|
8
|
-
"--pre [id]",
|
|
9
|
-
"Prerelease identifier. Use this when creating a prerelease versioning.",
|
|
10
|
-
false
|
|
11
|
-
)
|
|
12
|
-
.option(
|
|
13
|
-
"-d, --dev",
|
|
14
|
-
"Release a dev version. This is a shorthand for a prerelease with a 'dev' identifier."
|
|
15
|
-
)
|
|
16
|
-
.option("--no-changelog", "Disable generating changelogs.")
|
|
17
|
-
.option("-c, --commit [msg]", "Commit changes in git.", false)
|
|
18
|
-
.action(version);
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { log } from "./log";
|
|
2
|
-
import { glob } from "glob";
|
|
3
|
-
import { join } from "path";
|
|
4
|
-
import { readFileSync, writeFileSync } from "fs";
|
|
5
|
-
import { capitalize } from "src/utils/common";
|
|
6
|
-
|
|
7
|
-
export const pimpChangelogs = async () => {
|
|
8
|
-
log.info("Pimping changelogs");
|
|
9
|
-
|
|
10
|
-
const g = join("packages", "**", "CHANGELOG.md");
|
|
11
|
-
const filePaths = await glob(g);
|
|
12
|
-
|
|
13
|
-
const changelogs = filePaths.map((fp) => {
|
|
14
|
-
const changelog = readFileSync(fp).toString();
|
|
15
|
-
|
|
16
|
-
const lines = changelog.split("\n").map((line) => {
|
|
17
|
-
if (line.substring(0, 2) === "* ") {
|
|
18
|
-
if (line.substring(0, 4) === "* **")
|
|
19
|
-
return `- ${line.substring(2).split("** ").map(capitalize).join("** ")}`;
|
|
20
|
-
|
|
21
|
-
return `- ${capitalize(line.substring(2))}`;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (line.includes("**Note:**"))
|
|
25
|
-
return line.replace("**Note:**", "**📝 Note:**");
|
|
26
|
-
|
|
27
|
-
if (line.substring(0, 4) === "### ")
|
|
28
|
-
return line
|
|
29
|
-
.replace("### Features", "### 🚀 Enhancements")
|
|
30
|
-
.replace("### Bug Fixes", "### 🩹 Fixes")
|
|
31
|
-
.replace("### Chore", "### 🏡 Chore")
|
|
32
|
-
.replace("### Performance Improvements", "### 🔥 Performance");
|
|
33
|
-
|
|
34
|
-
return line;
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
return lines.join("\n");
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
await filePaths.forEach((file, idx) => {
|
|
41
|
-
writeFileSync(file, changelogs[idx]);
|
|
42
|
-
});
|
|
43
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { lerna } from "src/scripts/lerna";
|
|
2
|
-
import { git } from "src/scripts/git";
|
|
3
|
-
import type { VersionOptions } from "./VersionOptions";
|
|
4
|
-
import { log } from "./log";
|
|
5
|
-
import { getPreid } from "./getPreid";
|
|
6
|
-
import { pimpChangelogs } from "./pimpChangelogs";
|
|
7
|
-
|
|
8
|
-
export const version = async (options: VersionOptions) => {
|
|
9
|
-
const { pre, dev, changelog, commit, yes } = options;
|
|
10
|
-
|
|
11
|
-
lerna.version({
|
|
12
|
-
conventionalCommits: true,
|
|
13
|
-
conventionalGraduate: (!dev && !pre) || undefined,
|
|
14
|
-
conventionalPrerelease: !!dev || !!pre || undefined,
|
|
15
|
-
preid: dev ? "dev" : getPreid(pre),
|
|
16
|
-
includeMergedTags: true,
|
|
17
|
-
gitTagVersion: false,
|
|
18
|
-
private: false,
|
|
19
|
-
push: false,
|
|
20
|
-
changelog,
|
|
21
|
-
yes,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
if (changelog) await pimpChangelogs();
|
|
25
|
-
|
|
26
|
-
if (commit) {
|
|
27
|
-
log.info("Commit changes.");
|
|
28
|
-
const msg = commit === true ? "chore: Prepare Release" : commit;
|
|
29
|
-
git.commit({
|
|
30
|
-
m: msg,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
};
|
package/src/constants.ts
DELETED
package/src/index.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { program } from "commander";
|
|
3
|
-
import { PROGRAM_NAME, VERSION } from "./constants";
|
|
4
|
-
import commands from "./commands";
|
|
5
|
-
import { preAction } from "./preAction";
|
|
6
|
-
|
|
7
|
-
program
|
|
8
|
-
.name(PROGRAM_NAME)
|
|
9
|
-
.description(
|
|
10
|
-
"A collection of commands and scripts for helping running, building, deploying and assisting in developing with Gluhar, Vue, Nuxt, Tailwind & Sanity."
|
|
11
|
-
)
|
|
12
|
-
.version(VERSION, "-v, --version", "Output the version number.")
|
|
13
|
-
.helpOption("-h, --help", "Display help for a command.")
|
|
14
|
-
.option("-l, --log-level <level>", "Set log level.", "info")
|
|
15
|
-
.option("-lp, --log-prefix <prefixes...>", "Set log prefixes.")
|
|
16
|
-
.option("--ci", "Enable CI mode. Full logging and no prompts.", false)
|
|
17
|
-
.option("--cwd <path>", "The current working directory for the scripts.")
|
|
18
|
-
.usage("<command> [options]")
|
|
19
|
-
.hook("preAction", preAction)
|
|
20
|
-
.action(() => program.outputHelp());
|
|
21
|
-
|
|
22
|
-
commands.forEach((cmd) => program.addCommand(cmd));
|
|
23
|
-
|
|
24
|
-
program.parse(process.argv);
|
package/src/preAction.ts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { existsSync } from "fs";
|
|
2
|
-
import type { Command } from "commander";
|
|
3
|
-
import { confirmQuestion, init, logger } from "./utils";
|
|
4
|
-
import type { GlobalOptions } from "./GlobalOptions";
|
|
5
|
-
import { cmd, executeCmd, getCmdOutput } from "./scripts/cmd";
|
|
6
|
-
import { PROGRAM_NAME, VERSION } from "./constants";
|
|
7
|
-
import { git } from "./scripts/git";
|
|
8
|
-
// import { getConfigOpt, setConfigOpt } from './config';
|
|
9
|
-
|
|
10
|
-
const getOptions = <T>(command: Command) => command.opts() as T;
|
|
11
|
-
const log = logger("cli");
|
|
12
|
-
|
|
13
|
-
// const loadConfig = (rootCmd: Command, actionCmd: Command) => {
|
|
14
|
-
// const config = getConfigOpt(actionCmd.name());
|
|
15
|
-
// setConfigOpt(config, rootCmd, actionCmd);
|
|
16
|
-
// };
|
|
17
|
-
|
|
18
|
-
const setupCi = (rootCmd: Command, actionCmd: Command) => {
|
|
19
|
-
const { ci } = getOptions<GlobalOptions>(rootCmd);
|
|
20
|
-
const ciSource = rootCmd.getOptionValueSource("ci") ?? "implied";
|
|
21
|
-
|
|
22
|
-
if (ci) {
|
|
23
|
-
rootCmd.setOptionValueWithSource("yes", true, ciSource);
|
|
24
|
-
actionCmd.setOptionValueWithSource("yes", true, ciSource);
|
|
25
|
-
rootCmd.setOptionValueWithSource("logLevel", "verbose", ciSource);
|
|
26
|
-
rootCmd.setOptionValueWithSource("logPrefix", undefined, ciSource);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const setupLogging = (rootCmd: Command) => {
|
|
31
|
-
const { logLevel, logPrefix } = getOptions<GlobalOptions>(rootCmd);
|
|
32
|
-
init(PROGRAM_NAME, logLevel, logPrefix);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const setup = (rootCmd: Command, actionCmd: Command) => {
|
|
36
|
-
setupCi(rootCmd, actionCmd);
|
|
37
|
-
setupLogging(rootCmd);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const logCli = (actionCmd: Command) => {
|
|
41
|
-
log.notice(`v${VERSION}`);
|
|
42
|
-
|
|
43
|
-
log.verbose("Calling command:", actionCmd.name());
|
|
44
|
-
log.verbose("arguments:", actionCmd.args);
|
|
45
|
-
log.verbose("options:", getOptions(actionCmd));
|
|
46
|
-
log.verbose("cwd:", process.cwd());
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const checkCliVersion = async () => {
|
|
50
|
-
const hasGit = existsSync(".git");
|
|
51
|
-
if (hasGit && git.getRepo() === "gluhar") return;
|
|
52
|
-
|
|
53
|
-
const latestVersion = getCmdOutput("npm show @gluhar/cli version");
|
|
54
|
-
|
|
55
|
-
// Version is up to date
|
|
56
|
-
if (latestVersion === VERSION) return;
|
|
57
|
-
|
|
58
|
-
// Version is old, ask to install latest
|
|
59
|
-
const installLatest = await confirmQuestion(
|
|
60
|
-
`There is a newer version of the gluhar/cli available (v${latestVersion}). \nDo you want to install it now? (npm i -g @gluhar/cli)`
|
|
61
|
-
);
|
|
62
|
-
if (installLatest) {
|
|
63
|
-
executeCmd("npm i -g @gluhar/cli@latest");
|
|
64
|
-
|
|
65
|
-
// If we are in a project, also update the local version
|
|
66
|
-
const isLocal = !getCmdOutput("npm list @gluhar/cli --depth=0").includes(
|
|
67
|
-
"empty"
|
|
68
|
-
);
|
|
69
|
-
if (isLocal) executeCmd("npm update @gluhar/cli");
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const preAction = async (rootCmd: Command, actionCmd: Command) => {
|
|
74
|
-
// setup logging before loadConfig, so we can get logging from loadConfig
|
|
75
|
-
setup(rootCmd, actionCmd);
|
|
76
|
-
|
|
77
|
-
const { cwd: initCwd } = getOptions<GlobalOptions>(rootCmd);
|
|
78
|
-
if (initCwd) cmd.cd(initCwd);
|
|
79
|
-
|
|
80
|
-
// Check for newer cli version
|
|
81
|
-
await checkCliVersion();
|
|
82
|
-
|
|
83
|
-
// loadConfig(rootCmd, actionCmd);
|
|
84
|
-
|
|
85
|
-
const { cwd: newCwd } = getOptions<GlobalOptions>(rootCmd);
|
|
86
|
-
if (newCwd && newCwd !== initCwd) cmd.cd(newCwd);
|
|
87
|
-
|
|
88
|
-
// setup logging after loadConfig so we apply options from config
|
|
89
|
-
setup(rootCmd, actionCmd);
|
|
90
|
-
|
|
91
|
-
logCli(actionCmd);
|
|
92
|
-
if (initCwd) log.notice("from", initCwd);
|
|
93
|
-
};
|
package/src/scripts/cmd/cd.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { spawnSync } from 'child_process';
|
|
2
|
-
import { log } from './log';
|
|
3
|
-
import type { Args } from './types';
|
|
4
|
-
import { parseArgs } from './parseArgs';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Function that executes a bash script from string.
|
|
8
|
-
* @param cmd A one-line string of a bash command: 'npm install'.
|
|
9
|
-
* @param args Option flags to pass to the script: { m: 'Message', msg: 'asdf' }.
|
|
10
|
-
* @returns Executes the bash script in the same stdio.
|
|
11
|
-
*/
|
|
12
|
-
export const executeCmd = (cmd: string, args?: Args) => {
|
|
13
|
-
const cmdArgs = [cmd];
|
|
14
|
-
if (args) {
|
|
15
|
-
cmdArgs.push(...parseArgs(args));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const fullCmd = cmdArgs.join(' ');
|
|
19
|
-
log.verbose('executeCmd:', fullCmd);
|
|
20
|
-
return spawnSync(fullCmd, { stdio: 'inherit', shell: true });
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// TODO make an async option
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'child_process';
|
|
2
|
-
import { log } from './log';
|
|
3
|
-
import type { Args } from './types';
|
|
4
|
-
import { parseArgs } from './parseArgs';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A function that runs a bash script from a string and returns the output.
|
|
8
|
-
* Mainly used in js logic if you want the output of a bash script.
|
|
9
|
-
* @param cmd A one-line string of a bash command: 'npm install'.
|
|
10
|
-
* @param args Option flags to pass to the script: { m: 'Message', msg: 'asdf' }.
|
|
11
|
-
* @returns The output of the command as a string.
|
|
12
|
-
*/
|
|
13
|
-
export const getCmdOutput = (cmd: string, args?: Args) => {
|
|
14
|
-
const cmdArgs = [cmd];
|
|
15
|
-
if (args) {
|
|
16
|
-
cmdArgs.push(...parseArgs(args));
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const fullCmd = cmdArgs.join(' ');
|
|
20
|
-
log.verbose('getCmdOutput:', fullCmd);
|
|
21
|
-
return execSync(fullCmd).toString().trim();
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// TODO make an async option
|
|
25
|
-
// TODO get output from a script file?
|
|
26
|
-
// TODO maybe utilise the other two function instead of execSync?
|
package/src/scripts/cmd/log.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import humps from "humps";
|
|
2
|
-
import type { Args, NotNullableProps, ParsedArg } from "./types";
|
|
3
|
-
|
|
4
|
-
const hyphenize = (s: string) => humps.decamelize(s, { separator: "-" });
|
|
5
|
-
|
|
6
|
-
const hasValue = (arg: ParsedArg): arg is NotNullableProps<ParsedArg> => {
|
|
7
|
-
return arg.value !== undefined;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const parseArgs = (args: Args): string[] => {
|
|
11
|
-
return Object.entries(args)
|
|
12
|
-
.map(
|
|
13
|
-
([name, value]): ParsedArg => ({
|
|
14
|
-
name,
|
|
15
|
-
parsedName: hyphenize(name),
|
|
16
|
-
value,
|
|
17
|
-
parsedValue: JSON.stringify(value),
|
|
18
|
-
})
|
|
19
|
-
)
|
|
20
|
-
.filter(hasValue)
|
|
21
|
-
.reduce((result, { name, parsedName, value, parsedValue }) => {
|
|
22
|
-
if (name.length > 1) {
|
|
23
|
-
result.push(`--${parsedName}`);
|
|
24
|
-
} else {
|
|
25
|
-
result.push(`-${parsedName}`);
|
|
26
|
-
}
|
|
27
|
-
value.toString();
|
|
28
|
-
|
|
29
|
-
if (value !== true) {
|
|
30
|
-
let v = parsedValue;
|
|
31
|
-
if (
|
|
32
|
-
v.length > 2 &&
|
|
33
|
-
v[0] === '"' &&
|
|
34
|
-
v[v.length - 1] === '"' &&
|
|
35
|
-
!v.includes(" ")
|
|
36
|
-
)
|
|
37
|
-
v = v.slice(1, -1);
|
|
38
|
-
|
|
39
|
-
result.push(v);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return result;
|
|
43
|
-
}, [] as string[]);
|
|
44
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { log } from './log';
|
|
2
|
-
import type { Args } from './types';
|
|
3
|
-
import { parseArgs } from './parseArgs';
|
|
4
|
-
|
|
5
|
-
export const parseBashArgs = (
|
|
6
|
-
path: string,
|
|
7
|
-
args?: Args,
|
|
8
|
-
absolute?: boolean,
|
|
9
|
-
) => {
|
|
10
|
-
const filePath = path.endsWith('.sh') ? path : `${path}.sh`;
|
|
11
|
-
const absolutePath = !absolute ? `${__dirname}/../${filePath}` : filePath;
|
|
12
|
-
const flags = [absolutePath];
|
|
13
|
-
|
|
14
|
-
if (args) {
|
|
15
|
-
flags.push(...parseArgs(args));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
log.verbose('executeBash:', flags.join(' '));
|
|
19
|
-
|
|
20
|
-
return flags;
|
|
21
|
-
};
|
package/src/scripts/cmd/types.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type ArgValue = string | number | boolean;
|
|
2
|
-
export type Args = Record<string, ArgValue | undefined> | {};
|
|
3
|
-
|
|
4
|
-
export interface ParsedArg {
|
|
5
|
-
name: string;
|
|
6
|
-
parsedName: string;
|
|
7
|
-
value: ArgValue | undefined;
|
|
8
|
-
parsedValue: string | undefined;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type NotNullableProps<T> = {
|
|
12
|
-
[K in keyof T]: NonNullable<T[K]>;
|
|
13
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { join, relative } from "path";
|
|
2
|
-
import { copyFiles, FileInfoUpdate } from "./copyFiles";
|
|
3
|
-
import { log } from "./log";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Function that copies all files recursively from one dir to another allowing to update their content in the process.
|
|
7
|
-
* @param sourcePath Directory of files to copy recursively.
|
|
8
|
-
* @param destinationPath Destination directory to place files.
|
|
9
|
-
* @param updateContent Optional function that updates the contents of each file.
|
|
10
|
-
*/
|
|
11
|
-
export const copyDir = (
|
|
12
|
-
sourcePath: string,
|
|
13
|
-
destinationPath: string,
|
|
14
|
-
updateFile?: FileInfoUpdate
|
|
15
|
-
) => {
|
|
16
|
-
log.verbose("copyDir", { sourcePath, destinationPath });
|
|
17
|
-
const glob = join(sourcePath, "**", "*.*");
|
|
18
|
-
|
|
19
|
-
return copyFiles([glob], (file) => {
|
|
20
|
-
const newDir = join(destinationPath, relative(sourcePath, file.dir));
|
|
21
|
-
log.verbose("copyDir file from", file.dir, "to", newDir);
|
|
22
|
-
const f = updateFile ? updateFile(file) : file;
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
...f,
|
|
26
|
-
dir: newDir,
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
2
|
-
import { glob } from "glob";
|
|
3
|
-
import { type ParsedPath, parse, resolve, format } from "path";
|
|
4
|
-
import { exists } from "fs-extra";
|
|
5
|
-
import { log } from "./log";
|
|
6
|
-
|
|
7
|
-
export interface FileInfo extends Omit<ParsedPath, "root"> {
|
|
8
|
-
name: string;
|
|
9
|
-
content: string;
|
|
10
|
-
encoding: BufferEncoding;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type FileInfoUpdate = (fileInfo: FileInfo) => Partial<FileInfo>;
|
|
14
|
-
|
|
15
|
-
export const loadFiles = async (globs: string[]): Promise<FileInfo[]> => {
|
|
16
|
-
const { isText } = await import("istextorbinary");
|
|
17
|
-
|
|
18
|
-
log.verbose("Globs:", globs);
|
|
19
|
-
const filePaths = await glob(globs, {
|
|
20
|
-
nodir: true,
|
|
21
|
-
dot: true,
|
|
22
|
-
nocase: true,
|
|
23
|
-
});
|
|
24
|
-
log.verbose("Loaded files:", filePaths.length);
|
|
25
|
-
|
|
26
|
-
const files = filePaths.map(async (path): Promise<FileInfo> => {
|
|
27
|
-
const encoding = isText(path) ? "utf-8" : "binary";
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
...parse(path),
|
|
31
|
-
content: await readFile(path, encoding),
|
|
32
|
-
encoding,
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
return Promise.all(files);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const updateFiles = (
|
|
40
|
-
files: FileInfo[],
|
|
41
|
-
update: FileInfoUpdate
|
|
42
|
-
): FileInfo[] => {
|
|
43
|
-
return files.map((original): FileInfo => {
|
|
44
|
-
log.verbose("Updating file", original.dir, original.base);
|
|
45
|
-
const updated = update(original);
|
|
46
|
-
return {
|
|
47
|
-
...original,
|
|
48
|
-
...updated,
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const getPath = (relative: string) => resolve(process.cwd(), relative);
|
|
54
|
-
|
|
55
|
-
const write = async (files: FileInfo[]) => {
|
|
56
|
-
const writes = files.map(async (file) => {
|
|
57
|
-
const dirPath = getPath(file.dir);
|
|
58
|
-
const dirExists = await exists(dirPath);
|
|
59
|
-
if (!dirExists) {
|
|
60
|
-
await mkdir(dirPath, { recursive: true });
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const filePath = getPath(format(file));
|
|
64
|
-
log.verbose("Writing file", filePath);
|
|
65
|
-
await writeFile(filePath, file.content, file.encoding);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
await Promise.all(writes);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const copyFiles = async (globs: string[], update: FileInfoUpdate) => {
|
|
72
|
-
const files = await loadFiles(globs);
|
|
73
|
-
const updatedFiles = updateFiles(files, update);
|
|
74
|
-
await write(updatedFiles);
|
|
75
|
-
};
|