@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,29 +0,0 @@
|
|
|
1
|
-
import { existsSync } from 'fs';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import { log } from './log';
|
|
4
|
-
|
|
5
|
-
const searchFile = (fileName: string, dir: string): string | null => {
|
|
6
|
-
const filePath = join(dir, fileName);
|
|
7
|
-
|
|
8
|
-
if (existsSync(filePath)) {
|
|
9
|
-
log.verbose('Found file:', filePath);
|
|
10
|
-
return filePath;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const parent = join(dir, '..');
|
|
14
|
-
|
|
15
|
-
if (parent === dir || !existsSync(parent)) {
|
|
16
|
-
log.verbose('File not found:', fileName);
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return searchFile(fileName, parent);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const findFile = (
|
|
24
|
-
fileName: string,
|
|
25
|
-
dir: string = process.cwd(),
|
|
26
|
-
): string | null => {
|
|
27
|
-
log.verbose('Looking for file:', fileName);
|
|
28
|
-
return searchFile(fileName, dir);
|
|
29
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { copyDir } from "./copyDir";
|
|
2
|
-
import { readDirRecursive } from "./readDirRecursive";
|
|
3
|
-
import { loadJsonFile } from "./loadJsonFile";
|
|
4
|
-
import { findFile } from "./findFile";
|
|
5
|
-
import { copyFiles, loadFiles, updateFiles } from "./copyFiles";
|
|
6
|
-
|
|
7
|
-
export const filesystem = {
|
|
8
|
-
copyDir,
|
|
9
|
-
copyFiles,
|
|
10
|
-
loadFiles,
|
|
11
|
-
updateFiles,
|
|
12
|
-
readDirRecursive,
|
|
13
|
-
loadJsonFile,
|
|
14
|
-
findFile,
|
|
15
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'fs';
|
|
2
|
-
import { log } from './log';
|
|
3
|
-
|
|
4
|
-
export const loadJsonFile = <T>(filePath: string): T | null => {
|
|
5
|
-
log.verbose('Try to load JSON file:', filePath);
|
|
6
|
-
const invalidPath = !filePath || !existsSync(filePath);
|
|
7
|
-
if (invalidPath) {
|
|
8
|
-
log.verbose('Invalid file path:', filePath);
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const json = readFileSync(filePath).toString();
|
|
13
|
-
const result = JSON.parse(json) as T;
|
|
14
|
-
|
|
15
|
-
log.verbose('Successfully loaded JSON file:', filePath);
|
|
16
|
-
return result;
|
|
17
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { readdirSync, statSync } from 'fs-extra';
|
|
2
|
-
import { resolve, join } from 'path';
|
|
3
|
-
|
|
4
|
-
const readDirStep = (
|
|
5
|
-
absoluteDirPath: string,
|
|
6
|
-
relativeDirPath: string,
|
|
7
|
-
): string[] =>
|
|
8
|
-
readdirSync(absoluteDirPath).reduce((result: string[], current: string) => {
|
|
9
|
-
const absPath = resolve(absoluteDirPath, current);
|
|
10
|
-
const relPath = join(relativeDirPath, current);
|
|
11
|
-
const isDirectory = statSync(absPath).isDirectory();
|
|
12
|
-
|
|
13
|
-
if (isDirectory) {
|
|
14
|
-
return [...result, ...readDirStep(absPath, relPath)];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return [...result, relPath];
|
|
18
|
-
}, []);
|
|
19
|
-
|
|
20
|
-
export const readDirRecursive = (dirPath: string): string[] =>
|
|
21
|
-
readDirStep(dirPath, '');
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// BRANCH=${npm_config_branch};
|
|
2
|
-
// LOCAL=$(git branch --list $BRANCH);
|
|
3
|
-
// if [ $LOCAL ];
|
|
4
|
-
// then git branch -D $BRANCH; fi;
|
|
5
|
-
// REMOTE=$(git ls-remote --heads origin $BRANCH);
|
|
6
|
-
// if [ $REMOTE ];
|
|
7
|
-
// then git push origin -d $BRANCH; fi
|
|
8
|
-
|
|
9
|
-
import { executeCmd } from 'src/scripts/cmd';
|
|
10
|
-
import { log } from '../log';
|
|
11
|
-
|
|
12
|
-
export interface BranchDeleteOptions {
|
|
13
|
-
local?: boolean;
|
|
14
|
-
remote?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const branchDelete = (
|
|
18
|
-
branch: string,
|
|
19
|
-
options: BranchDeleteOptions = {},
|
|
20
|
-
) => {
|
|
21
|
-
const { local, remote } = options;
|
|
22
|
-
|
|
23
|
-
if (local) {
|
|
24
|
-
log.verbose('Delete local branch:', branch);
|
|
25
|
-
executeCmd(`git branch -D ${branch}`);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (remote) {
|
|
29
|
-
log.verbose('Delete remote branch:', branch);
|
|
30
|
-
executeCmd(`git push origin -d ${branch}`);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { getCmdOutput } from 'src/scripts/cmd';
|
|
2
|
-
import { log } from '../log';
|
|
3
|
-
|
|
4
|
-
export const branchExists = (branchName: string) => {
|
|
5
|
-
const local = !!getCmdOutput(`git branch --list ${branchName}`);
|
|
6
|
-
const remote = !!getCmdOutput(`git ls-remote --heads origin ${branchName}`);
|
|
7
|
-
|
|
8
|
-
log.verbose('branchExists:', { local, remote });
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
local,
|
|
12
|
-
remote,
|
|
13
|
-
};
|
|
14
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { executeCmd } from 'src/scripts/cmd';
|
|
2
|
-
|
|
3
|
-
export interface CheckoutOptions {
|
|
4
|
-
newBranch?: boolean;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const checkout = (branchName: string, opt: CheckoutOptions = {}) => {
|
|
8
|
-
const { newBranch = false } = opt;
|
|
9
|
-
|
|
10
|
-
const cmd = ['git checkout'];
|
|
11
|
-
if (newBranch) {
|
|
12
|
-
cmd.push('-b');
|
|
13
|
-
}
|
|
14
|
-
cmd.push(branchName);
|
|
15
|
-
|
|
16
|
-
const fullCmd = cmd.join(' ');
|
|
17
|
-
|
|
18
|
-
return executeCmd(fullCmd);
|
|
19
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { getCmdOutput } from 'src/scripts/cmd';
|
|
2
|
-
import { log } from '../log';
|
|
3
|
-
|
|
4
|
-
export interface BranchInfo {
|
|
5
|
-
fullName: string;
|
|
6
|
-
type?: 'dev' | 'prep' | 'release' | string;
|
|
7
|
-
name: string;
|
|
8
|
-
isDev: boolean;
|
|
9
|
-
isPrep: boolean;
|
|
10
|
-
isRelease: boolean;
|
|
11
|
-
isOther: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const getCurrentBranch = (): BranchInfo => {
|
|
15
|
-
const fullName = getCmdOutput('git rev-parse --abbrev-ref HEAD');
|
|
16
|
-
let [type, name]: (string | undefined)[] = fullName.split('/');
|
|
17
|
-
if (!name) {
|
|
18
|
-
name = type;
|
|
19
|
-
type = undefined;
|
|
20
|
-
}
|
|
21
|
-
const isDev = type === 'dev';
|
|
22
|
-
const isPrep = type === 'prep';
|
|
23
|
-
const isRelease = type === 'release';
|
|
24
|
-
const isOther = !isDev && !isPrep && !isRelease;
|
|
25
|
-
|
|
26
|
-
log.verbose('Current branch:', fullName);
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
fullName,
|
|
30
|
-
type,
|
|
31
|
-
name,
|
|
32
|
-
isDev,
|
|
33
|
-
isPrep,
|
|
34
|
-
isRelease,
|
|
35
|
-
isOther,
|
|
36
|
-
};
|
|
37
|
-
};
|
package/src/scripts/git/clone.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { executeCmd } from "src/scripts/cmd";
|
|
2
|
-
import { log } from "./log";
|
|
3
|
-
|
|
4
|
-
export interface CloneOptions {
|
|
5
|
-
branch?: string;
|
|
6
|
-
singleBranch?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Clone a repo.
|
|
11
|
-
* @param repo The repo name in the format: 'gluharry/starters'.
|
|
12
|
-
*/
|
|
13
|
-
export const clone = (
|
|
14
|
-
repo: string,
|
|
15
|
-
dir: string = "",
|
|
16
|
-
options: CloneOptions = {}
|
|
17
|
-
) => {
|
|
18
|
-
log.verbose("Cloning:", repo, dir, options);
|
|
19
|
-
executeCmd(`git clone https://github.com/${repo}.git ${dir}`, options);
|
|
20
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { getCmdOutput } from "../cmd";
|
|
2
|
-
|
|
3
|
-
export const getRepo = (): string => {
|
|
4
|
-
const url = getCmdOutput("git remote get-url origin");
|
|
5
|
-
const urlParts = url.split("/");
|
|
6
|
-
|
|
7
|
-
// "dev-tools.git"
|
|
8
|
-
const lastPart = urlParts[urlParts.length - 1];
|
|
9
|
-
// "dev-tools"
|
|
10
|
-
return lastPart.split(".")[0];
|
|
11
|
-
};
|
package/src/scripts/git/index.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { executeBash, executeCmd } from "src/scripts/cmd";
|
|
2
|
-
import { branchDelete } from "./branch/branchDelete";
|
|
3
|
-
import { openPr } from "./openPr";
|
|
4
|
-
import { remoteStatus } from "./remoteStatus";
|
|
5
|
-
import { getCurrentBranch } from "./branch/getCurrentBranch";
|
|
6
|
-
import { checkout } from "./branch/checkout";
|
|
7
|
-
import { branchExists } from "./branch/branchExists";
|
|
8
|
-
import { createTag } from "./tag/createTag";
|
|
9
|
-
import type { Args } from "../cmd/types";
|
|
10
|
-
import { getRepo } from "./getRepo";
|
|
11
|
-
import { getTags } from "./tag/getTags";
|
|
12
|
-
import { pushAllTags } from "./tag/pushAllTags";
|
|
13
|
-
import { deleteTag } from "./tag/deleteTag";
|
|
14
|
-
import { renameTag } from "./tag/renameTag";
|
|
15
|
-
import { clone } from "./clone";
|
|
16
|
-
|
|
17
|
-
export const git = {
|
|
18
|
-
openPr,
|
|
19
|
-
getRepo,
|
|
20
|
-
remoteStatus,
|
|
21
|
-
commit: (args: Args) => executeBash(`git/commit`, args),
|
|
22
|
-
push: (branchOrTag: string, remote = "origin") =>
|
|
23
|
-
executeCmd(`git push ${remote} ${branchOrTag}`),
|
|
24
|
-
pull: (branchName: string, remote = "origin") =>
|
|
25
|
-
executeCmd(`git pull ${remote} ${branchName}`),
|
|
26
|
-
merge: (branchName: string, y?: boolean) =>
|
|
27
|
-
executeCmd(`git merge ${branchName}${y ? " --no-edit" : ""}`),
|
|
28
|
-
branch: {
|
|
29
|
-
exists: branchExists,
|
|
30
|
-
delete: branchDelete,
|
|
31
|
-
getCurrent: getCurrentBranch,
|
|
32
|
-
checkout,
|
|
33
|
-
},
|
|
34
|
-
tag: {
|
|
35
|
-
getAll: getTags,
|
|
36
|
-
create: createTag,
|
|
37
|
-
delete: deleteTag,
|
|
38
|
-
rename: renameTag,
|
|
39
|
-
pushAll: pushAllTags,
|
|
40
|
-
},
|
|
41
|
-
clone,
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export type { BranchInfo } from "./branch/getCurrentBranch";
|
package/src/scripts/git/log.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import shell from "shelljs";
|
|
2
|
-
import { log } from "./log";
|
|
3
|
-
import { getRepo } from "./getRepo";
|
|
4
|
-
|
|
5
|
-
export const openPr = (sourceBranch: string, destinationBranch: string) => {
|
|
6
|
-
const repo = getRepo();
|
|
7
|
-
|
|
8
|
-
const link = [
|
|
9
|
-
"https://bitbucket.org/pezak/",
|
|
10
|
-
repo,
|
|
11
|
-
"/pull-requests/new?",
|
|
12
|
-
`source=${sourceBranch}`,
|
|
13
|
-
"&",
|
|
14
|
-
`dest=${destinationBranch}`,
|
|
15
|
-
].join("");
|
|
16
|
-
|
|
17
|
-
log.verbose("Open PR Link:", link);
|
|
18
|
-
log.error("Har: This command does not work for the moment.");
|
|
19
|
-
|
|
20
|
-
// shell.open(link);
|
|
21
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { getCmdOutput } from 'src/scripts/cmd';
|
|
2
|
-
import { log } from './log';
|
|
3
|
-
|
|
4
|
-
export type RemoteStatus =
|
|
5
|
-
| 'up-to-date'
|
|
6
|
-
| 'need-to-pull'
|
|
7
|
-
| 'need-to-push'
|
|
8
|
-
| 'diverged';
|
|
9
|
-
|
|
10
|
-
export const remoteStatus = (branch = '@', upstream = '@{u}'): RemoteStatus => {
|
|
11
|
-
const local = getCmdOutput(`git rev-parse ${branch}`);
|
|
12
|
-
const remote = getCmdOutput(`git rev-parse ${upstream}`);
|
|
13
|
-
const base = getCmdOutput(`git merge-base ${branch} ${upstream}`);
|
|
14
|
-
|
|
15
|
-
log.verbose('remoteStatus:', { local, remote, base });
|
|
16
|
-
|
|
17
|
-
if (local === remote) {
|
|
18
|
-
return 'up-to-date';
|
|
19
|
-
}
|
|
20
|
-
if (local === base) {
|
|
21
|
-
return 'need-to-pull';
|
|
22
|
-
}
|
|
23
|
-
if (remote === base) {
|
|
24
|
-
return 'need-to-push';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return 'diverged';
|
|
28
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { executeCmd } from '../../cmd';
|
|
2
|
-
|
|
3
|
-
export interface TagCreateOptions {
|
|
4
|
-
/**
|
|
5
|
-
* The object that the new tag will refer to, usually a commit.
|
|
6
|
-
* Defaults to HEAD.
|
|
7
|
-
*/
|
|
8
|
-
object?: string;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Replace an existing tag with the given name (instead of failing)
|
|
12
|
-
*/
|
|
13
|
-
force?: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Create a new annotated tag. Doesn't push it to the remote.
|
|
18
|
-
* @param name The name of the tag to create.
|
|
19
|
-
* @param object The object that the new tag will refer to, usually a commit. Defaults to HEAD.
|
|
20
|
-
*/
|
|
21
|
-
export const createTag = (name: string, options: TagCreateOptions = {}) => {
|
|
22
|
-
const { object = '', force } = options;
|
|
23
|
-
executeCmd(`git tag ${name} ${object}`, {
|
|
24
|
-
force,
|
|
25
|
-
annotate: true,
|
|
26
|
-
message: '',
|
|
27
|
-
});
|
|
28
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { executeCmd } from 'src/scripts/cmd';
|
|
2
|
-
import { log } from '../log';
|
|
3
|
-
|
|
4
|
-
export const deleteTag = (name: string) => {
|
|
5
|
-
log.verbose('Deleting tag locally and from remote:', name);
|
|
6
|
-
|
|
7
|
-
executeCmd('git tag', {
|
|
8
|
-
d: name,
|
|
9
|
-
});
|
|
10
|
-
executeCmd(`git push origin :${name}`);
|
|
11
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { log } from '../log';
|
|
2
|
-
import { createTag } from './createTag';
|
|
3
|
-
import { deleteTag } from './deleteTag';
|
|
4
|
-
|
|
5
|
-
export const renameTag = (oldTagName: string, newTagName: string) => {
|
|
6
|
-
log.verbose('Renaming tag ', oldTagName, ' -> ', newTagName);
|
|
7
|
-
|
|
8
|
-
createTag(newTagName, {
|
|
9
|
-
object: `${oldTagName}^{}`,
|
|
10
|
-
});
|
|
11
|
-
deleteTag(oldTagName);
|
|
12
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { getCmdOutput } from '../cmd';
|
|
2
|
-
import type { LernaPackage } from './types';
|
|
3
|
-
|
|
4
|
-
export const changed = (): LernaPackage[] => {
|
|
5
|
-
const jsonResult = getCmdOutput('npx lerna changed --json');
|
|
6
|
-
if (!jsonResult) {
|
|
7
|
-
return [];
|
|
8
|
-
}
|
|
9
|
-
const result = JSON.parse(jsonResult) as LernaPackage[];
|
|
10
|
-
return result;
|
|
11
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { getDependencies } from './getDependencies';
|
|
2
|
-
import { log } from './log';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Get packages that have a given dependency.
|
|
6
|
-
* @param dependency Name of the dependency.
|
|
7
|
-
* @returns List of package names, that have the given dependency.
|
|
8
|
-
*/
|
|
9
|
-
export function filterByDependency(
|
|
10
|
-
dependency: string,
|
|
11
|
-
excludePrivate = true,
|
|
12
|
-
): string[] {
|
|
13
|
-
log.verbose('getConfig', dependency, excludePrivate);
|
|
14
|
-
|
|
15
|
-
const allPackages = getDependencies(excludePrivate);
|
|
16
|
-
|
|
17
|
-
return Object.keys(allPackages).filter((name) => {
|
|
18
|
-
const deps = allPackages[name];
|
|
19
|
-
return deps.includes(dependency);
|
|
20
|
-
});
|
|
21
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { findFile } from 'src/scripts/filesystem/findFile';
|
|
2
|
-
import { loadJsonFile } from 'src/scripts/filesystem/loadJsonFile';
|
|
3
|
-
import type { LernaConfig } from './types';
|
|
4
|
-
import { lernaJson } from './constants';
|
|
5
|
-
import { log } from './log';
|
|
6
|
-
|
|
7
|
-
export const getConfig = () => {
|
|
8
|
-
const configPath = findFile(lernaJson) ?? '';
|
|
9
|
-
|
|
10
|
-
log.verbose('getConfig', configPath);
|
|
11
|
-
return loadJsonFile<LernaConfig>(configPath);
|
|
12
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { getBashOutput } from '../cmd';
|
|
2
|
-
import { log } from './log';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Get list of all packages in this monorepo,
|
|
6
|
-
* with all their dependant packages.
|
|
7
|
-
*
|
|
8
|
-
* Each key of the object is a package from this monorepo.
|
|
9
|
-
* The value is array of dependencies for each package.
|
|
10
|
-
*/
|
|
11
|
-
export function getDependencies(
|
|
12
|
-
excludePrivate = true,
|
|
13
|
-
): Record<string, string[]> {
|
|
14
|
-
log.verbose('getDependencies', excludePrivate);
|
|
15
|
-
|
|
16
|
-
const cmdResult = getBashOutput('lerna/list', {
|
|
17
|
-
graph: true,
|
|
18
|
-
all: !excludePrivate || undefined,
|
|
19
|
-
noPrivate: excludePrivate || undefined,
|
|
20
|
-
loglevel: 'silent',
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const packages = JSON.parse(cmdResult) as Record<string, string[]>;
|
|
24
|
-
return packages;
|
|
25
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { sep } from 'path';
|
|
2
|
-
import { getBashOutput } from '../cmd';
|
|
3
|
-
import type { LernaPackage, PackageDetails } from './types';
|
|
4
|
-
import { packagesDir, packagesPrefix } from './constants';
|
|
5
|
-
import { log } from './log';
|
|
6
|
-
|
|
7
|
-
// TODO might want to move this 2 funcs to a more global cross package util
|
|
8
|
-
const removePrefix = (txt: string, prefix: string) =>
|
|
9
|
-
txt.startsWith(prefix) ? txt.substring(prefix.length) : txt;
|
|
10
|
-
|
|
11
|
-
const toRelativePath = (absolutePath: string, baseDirName: string) => {
|
|
12
|
-
const basePath = `${sep}${baseDirName}${sep}`;
|
|
13
|
-
return absolutePath.substring(
|
|
14
|
-
absolutePath.lastIndexOf(basePath) + basePath.length,
|
|
15
|
-
);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const getDetails = (excludePrivate = true): PackageDetails[] => {
|
|
19
|
-
log.verbose('getDetails', excludePrivate);
|
|
20
|
-
|
|
21
|
-
const result = getBashOutput('lerna/list', {
|
|
22
|
-
json: true,
|
|
23
|
-
all: !excludePrivate || undefined,
|
|
24
|
-
noPrivate: excludePrivate || undefined,
|
|
25
|
-
loglevel: 'silent',
|
|
26
|
-
});
|
|
27
|
-
const lernaPackages = JSON.parse(result) as LernaPackage[];
|
|
28
|
-
|
|
29
|
-
return lernaPackages.map((pkg) => {
|
|
30
|
-
const relativePath = toRelativePath(pkg.location, packagesDir);
|
|
31
|
-
const displayName = `${relativePath} (${pkg.name})`;
|
|
32
|
-
const shortName = removePrefix(pkg.name, packagesPrefix);
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
name: pkg.name,
|
|
36
|
-
version: pkg.version,
|
|
37
|
-
isPrivate: pkg.private,
|
|
38
|
-
absolutePath: pkg.location,
|
|
39
|
-
relativePath,
|
|
40
|
-
displayName,
|
|
41
|
-
shortName,
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { executeBash } from 'src/scripts/cmd';
|
|
2
|
-
import { getConfig } from './getConfig';
|
|
3
|
-
import { changed } from './changed';
|
|
4
|
-
import { getDependencies } from './getDependencies';
|
|
5
|
-
import { filterByDependency } from './filterByDependency';
|
|
6
|
-
import { getDetails } from './getDetails';
|
|
7
|
-
import type { Args } from '../cmd/types';
|
|
8
|
-
|
|
9
|
-
export const lerna = {
|
|
10
|
-
version: (args?: Args) => executeBash('lerna/version', args),
|
|
11
|
-
publish: (args?: Args) => executeBash('lerna/publish', args),
|
|
12
|
-
list: (args?: Args) => executeBash('lerna/list', args),
|
|
13
|
-
changed,
|
|
14
|
-
getConfig,
|
|
15
|
-
getDependencies,
|
|
16
|
-
filterByDependency,
|
|
17
|
-
getDetails,
|
|
18
|
-
};
|
package/src/scripts/lerna/log.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
export interface LernaConfig extends Record<string, unknown> {
|
|
2
|
-
version: string;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export interface LernaPackage {
|
|
6
|
-
/**
|
|
7
|
-
* Name of the package from `package.json`.
|
|
8
|
-
* @example '@gluhar/core'
|
|
9
|
-
*/
|
|
10
|
-
name: string;
|
|
11
|
-
/**
|
|
12
|
-
* Version of the package from `package.json`.
|
|
13
|
-
* @example '1.2.3'
|
|
14
|
-
*/
|
|
15
|
-
version: string;
|
|
16
|
-
/**
|
|
17
|
-
* Looks for `private` property in the `package.json` file.
|
|
18
|
-
*/
|
|
19
|
-
private: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Absolute path to the package folder.
|
|
22
|
-
* @example 'Users/someone/Projects/gluhar/packages/core'
|
|
23
|
-
*/
|
|
24
|
-
location: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type ModuleName = "" | "dev" | "ui" | "sn";
|
|
28
|
-
|
|
29
|
-
export interface PackageDetails {
|
|
30
|
-
/**
|
|
31
|
-
* Relative path & package name.
|
|
32
|
-
* @example 'ui/app (@gluhar/core)'
|
|
33
|
-
*/
|
|
34
|
-
displayName: string;
|
|
35
|
-
/**
|
|
36
|
-
* Name of the package from `package.json`.
|
|
37
|
-
* @example '@gluhar/core'
|
|
38
|
-
*/
|
|
39
|
-
name: string;
|
|
40
|
-
/**
|
|
41
|
-
* Name without the `@gluhar/` prefix.
|
|
42
|
-
* @example 'core'
|
|
43
|
-
*/
|
|
44
|
-
shortName: string;
|
|
45
|
-
/**
|
|
46
|
-
* Absolute path to the package folder.
|
|
47
|
-
* @example 'Users/someone/Projects/gluhar/packages/core'
|
|
48
|
-
*/
|
|
49
|
-
absolutePath: string;
|
|
50
|
-
/**
|
|
51
|
-
* Relative path to the package folder, from the `packages` folder.
|
|
52
|
-
* @example 'core'
|
|
53
|
-
*/
|
|
54
|
-
relativePath: string;
|
|
55
|
-
/**
|
|
56
|
-
* Version of the package from `package.json`.
|
|
57
|
-
* @example 'v1.2.3'
|
|
58
|
-
*/
|
|
59
|
-
version: string;
|
|
60
|
-
/**
|
|
61
|
-
* Looks for `private` property in the `package.json` file.
|
|
62
|
-
*/
|
|
63
|
-
isPrivate: boolean;
|
|
64
|
-
}
|
package/src/utils/chalk.ts
DELETED
package/src/utils/common.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const capitalize = (s: string) => s[0].toUpperCase() + s.slice(1);
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Check if a command exists in the system PATH
|
|
5
|
-
* @param command The command to check
|
|
6
|
-
* @returns true if the command exists, false otherwise
|
|
7
|
-
*/
|
|
8
|
-
export const commandExists = (command: string): boolean => {
|
|
9
|
-
try {
|
|
10
|
-
const { spawnSync } = require("child_process");
|
|
11
|
-
const result = spawnSync("which", [command], { stdio: "ignore" });
|
|
12
|
-
return result.status === 0;
|
|
13
|
-
} catch {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
};
|
package/src/utils/inquirer.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import inquirer from "inquirer";
|
|
2
|
-
|
|
3
|
-
export interface ConfirmAnswer {
|
|
4
|
-
confirm: boolean;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const confirmQuestion = async (message: string, yes?: boolean) => {
|
|
8
|
-
if (yes) {
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const answer = await inquirer.prompt<ConfirmAnswer>([
|
|
13
|
-
{
|
|
14
|
-
name: "confirm",
|
|
15
|
-
type: "confirm",
|
|
16
|
-
message,
|
|
17
|
-
},
|
|
18
|
-
]);
|
|
19
|
-
return answer.confirm;
|
|
20
|
-
};
|