@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeBash.d.ts","sourceRoot":"","sources":["../../../../src/scripts/cmd/executeBash.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,EAAE,OAAO,IAAI,EAAE,WAAW,OAAO,qDAQxE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeBash = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const parseBashArgs_1 = require("./parseBashArgs");
|
|
6
|
+
/**
|
|
7
|
+
* Function that executes a bash script file in the same console from a given relative path. Can pass arguments/flags to the script.
|
|
8
|
+
* @param path A path to a bash script file, relative to one directory up: 'lerna/bootstrap'.
|
|
9
|
+
* @param args Option flags to pass to the script: { m: 'Message', msg: 'asdf' }.
|
|
10
|
+
* @param absolute Flag if you are providing an absolute path.
|
|
11
|
+
* @returns Executes the bash script file in the same stdio.
|
|
12
|
+
*/
|
|
13
|
+
const executeBash = (path, args, absolute) => {
|
|
14
|
+
const bashArgs = (0, parseBashArgs_1.parseBashArgs)(path, args, absolute);
|
|
15
|
+
// TODO make stdio configurable
|
|
16
|
+
// TODO make an async option
|
|
17
|
+
return (0, child_process_1.spawnSync)('bash', bashArgs, {
|
|
18
|
+
stdio: 'inherit',
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
exports.executeBash = executeBash;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Args } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Function that executes a bash script from string.
|
|
4
|
+
* @param cmd A one-line string of a bash command: 'npm install'.
|
|
5
|
+
* @param args Option flags to pass to the script: { m: 'Message', msg: 'asdf' }.
|
|
6
|
+
* @returns Executes the bash script in the same stdio.
|
|
7
|
+
*/
|
|
8
|
+
export declare const executeCmd: (cmd: string, args?: Args) => import("child_process").SpawnSyncReturns<Buffer>;
|
|
9
|
+
//# sourceMappingURL=executeCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeCmd.d.ts","sourceRoot":"","sources":["../../../../src/scripts/cmd/executeCmd.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAGpC;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,EAAE,OAAO,IAAI,qDASlD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeCmd = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const log_1 = require("./log");
|
|
6
|
+
const parseArgs_1 = require("./parseArgs");
|
|
7
|
+
/**
|
|
8
|
+
* Function that executes a bash script from string.
|
|
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 Executes the bash script in the same stdio.
|
|
12
|
+
*/
|
|
13
|
+
const executeCmd = (cmd, args) => {
|
|
14
|
+
const cmdArgs = [cmd];
|
|
15
|
+
if (args) {
|
|
16
|
+
cmdArgs.push(...(0, parseArgs_1.parseArgs)(args));
|
|
17
|
+
}
|
|
18
|
+
const fullCmd = cmdArgs.join(' ');
|
|
19
|
+
log_1.log.verbose('executeCmd:', fullCmd);
|
|
20
|
+
return (0, child_process_1.spawnSync)(fullCmd, { stdio: 'inherit', shell: true });
|
|
21
|
+
};
|
|
22
|
+
exports.executeCmd = executeCmd;
|
|
23
|
+
// TODO make an async option
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SpawnSyncReturns } from 'child_process';
|
|
2
|
+
/**
|
|
3
|
+
* Exits the process when a spawned command failed, so later steps don't run on a broken state.
|
|
4
|
+
* @param result The return value of `executeBash` / `executeCmd`.
|
|
5
|
+
* @param label What failed, for the error message: 'lerna publish'.
|
|
6
|
+
*/
|
|
7
|
+
export declare const exitOnFailure: (result: SpawnSyncReturns<Buffer>, label: string) => void;
|
|
8
|
+
//# sourceMappingURL=exitOnFailure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exitOnFailure.d.ts","sourceRoot":"","sources":["../../../../src/scripts/cmd/exitOnFailure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,gBAAgB,CAAC,MAAM,CAAC,EAChC,OAAO,MAAM,SAWd,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exitOnFailure = void 0;
|
|
4
|
+
const log_1 = require("./log");
|
|
5
|
+
/**
|
|
6
|
+
* Exits the process when a spawned command failed, so later steps don't run on a broken state.
|
|
7
|
+
* @param result The return value of `executeBash` / `executeCmd`.
|
|
8
|
+
* @param label What failed, for the error message: 'lerna publish'.
|
|
9
|
+
*/
|
|
10
|
+
const exitOnFailure = (result, label) => {
|
|
11
|
+
if (result.error) {
|
|
12
|
+
log_1.log.error(`${label} could not run:`, result.error.message);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
if (result.status !== 0) {
|
|
16
|
+
log_1.log.error(`${label} failed with exit code ${result.status ?? result.signal}.`);
|
|
17
|
+
process.exit(result.status || 1);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.exitOnFailure = exitOnFailure;
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* @returns The output of the bash file script as a string.
|
|
12
|
-
*/
|
|
13
|
-
export const getBashOutput = (
|
|
14
|
-
path: string,
|
|
15
|
-
args?: Args,
|
|
16
|
-
absolute?: boolean,
|
|
17
|
-
) => {
|
|
18
|
-
log.verbose('getBashOutput:', args);
|
|
19
|
-
|
|
20
|
-
const bashArgs = parseBashArgs(path, args, absolute).join(' ');
|
|
21
|
-
|
|
22
|
-
return getCmdOutput(`bash ${bashArgs}`);
|
|
23
|
-
};
|
|
1
|
+
import type { Args } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Function that executes a bash script file from a given relative path and returns the output. Can pass arguments/flags to the script.
|
|
4
|
+
* @param cmd A path to a bash script file, relative to one directory up: 'lerna/bootstrap'.
|
|
5
|
+
* @param options Option flags to pass to the script: { m: 'Message', msg: 'asdf' }.
|
|
6
|
+
* @param absolute Flag if you are providing an absolute path.
|
|
7
|
+
* @returns The output of the bash file script as a string.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getBashOutput: (path: string, args?: Args, absolute?: boolean) => string;
|
|
10
|
+
//# sourceMappingURL=getBashOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBashOutput.d.ts","sourceRoot":"","sources":["../../../../src/scripts/cmd/getBashOutput.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GACxB,MAAM,MAAM,EACZ,OAAO,IAAI,EACX,WAAW,OAAO,WAOnB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBashOutput = void 0;
|
|
4
|
+
const log_1 = require("./log");
|
|
5
|
+
const parseBashArgs_1 = require("./parseBashArgs");
|
|
6
|
+
const getCmdOutput_1 = require("./getCmdOutput");
|
|
7
|
+
/**
|
|
8
|
+
* Function that executes a bash script file from a given relative path and returns the output. Can pass arguments/flags to the script.
|
|
9
|
+
* @param cmd A path to a bash script file, relative to one directory up: 'lerna/bootstrap'.
|
|
10
|
+
* @param options Option flags to pass to the script: { m: 'Message', msg: 'asdf' }.
|
|
11
|
+
* @param absolute Flag if you are providing an absolute path.
|
|
12
|
+
* @returns The output of the bash file script as a string.
|
|
13
|
+
*/
|
|
14
|
+
const getBashOutput = (path, args, absolute) => {
|
|
15
|
+
log_1.log.verbose('getBashOutput:', args);
|
|
16
|
+
const bashArgs = (0, parseBashArgs_1.parseBashArgs)(path, args, absolute).join(' ');
|
|
17
|
+
return (0, getCmdOutput_1.getCmdOutput)(`bash ${bashArgs}`);
|
|
18
|
+
};
|
|
19
|
+
exports.getBashOutput = getBashOutput;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Args } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A function that runs a bash script from a string and returns the output.
|
|
4
|
+
* Mainly used in js logic if you want the output of a bash script.
|
|
5
|
+
* @param cmd A one-line string of a bash command: 'npm install'.
|
|
6
|
+
* @param args Option flags to pass to the script: { m: 'Message', msg: 'asdf' }.
|
|
7
|
+
* @returns The output of the command as a string.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getCmdOutput: (cmd: string, args?: Args) => string;
|
|
10
|
+
//# sourceMappingURL=getCmdOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCmdOutput.d.ts","sourceRoot":"","sources":["../../../../src/scripts/cmd/getCmdOutput.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAGpC;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,EAAE,OAAO,IAAI,WASpD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCmdOutput = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const log_1 = require("./log");
|
|
6
|
+
const parseArgs_1 = require("./parseArgs");
|
|
7
|
+
/**
|
|
8
|
+
* A function that runs a bash script from a string and returns the output.
|
|
9
|
+
* Mainly used in js logic if you want the output of a bash script.
|
|
10
|
+
* @param cmd A one-line string of a bash command: 'npm install'.
|
|
11
|
+
* @param args Option flags to pass to the script: { m: 'Message', msg: 'asdf' }.
|
|
12
|
+
* @returns The output of the command as a string.
|
|
13
|
+
*/
|
|
14
|
+
const getCmdOutput = (cmd, args) => {
|
|
15
|
+
const cmdArgs = [cmd];
|
|
16
|
+
if (args) {
|
|
17
|
+
cmdArgs.push(...(0, parseArgs_1.parseArgs)(args));
|
|
18
|
+
}
|
|
19
|
+
const fullCmd = cmdArgs.join(' ');
|
|
20
|
+
log_1.log.verbose('getCmdOutput:', fullCmd);
|
|
21
|
+
return (0, child_process_1.execSync)(fullCmd).toString().trim();
|
|
22
|
+
};
|
|
23
|
+
exports.getCmdOutput = getCmdOutput;
|
|
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?
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
1
|
+
export * from './executeBash';
|
|
2
|
+
export * from './executeCmd';
|
|
3
|
+
export * from './getCmdOutput';
|
|
4
|
+
export * from './getBashOutput';
|
|
5
|
+
export * from './exitOnFailure';
|
|
6
|
+
export declare const cmd: {
|
|
7
|
+
cd: (path: string) => void;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/scripts/cmd/index.ts"],"names":[],"mappings":"AAEA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAEhC,eAAO,MAAM,GAAG;;CAEf,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.cmd = void 0;
|
|
18
|
+
const cd_1 = require("./cd");
|
|
19
|
+
__exportStar(require("./executeBash"), exports);
|
|
20
|
+
__exportStar(require("./executeCmd"), exports);
|
|
21
|
+
__exportStar(require("./getCmdOutput"), exports);
|
|
22
|
+
__exportStar(require("./getBashOutput"), exports);
|
|
23
|
+
__exportStar(require("./exitOnFailure"), exports);
|
|
24
|
+
exports.cmd = {
|
|
25
|
+
cd: cd_1.cd,
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../../src/scripts/cmd/log.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,4BAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseArgs.d.ts","sourceRoot":"","sources":["../../../../src/scripts/cmd/parseArgs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAA+B,MAAM,SAAS,CAAC;AAQjE,eAAO,MAAM,SAAS,GAAI,MAAM,IAAI,KAAG,MAAM,EAkC5C,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.parseArgs = void 0;
|
|
7
|
+
const humps_1 = __importDefault(require("humps"));
|
|
8
|
+
const hyphenize = (s) => humps_1.default.decamelize(s, { separator: "-" });
|
|
9
|
+
const hasValue = (arg) => {
|
|
10
|
+
return arg.value !== undefined;
|
|
11
|
+
};
|
|
12
|
+
const parseArgs = (args) => {
|
|
13
|
+
return Object.entries(args)
|
|
14
|
+
.map(([name, value]) => ({
|
|
15
|
+
name,
|
|
16
|
+
parsedName: hyphenize(name),
|
|
17
|
+
value,
|
|
18
|
+
parsedValue: JSON.stringify(value),
|
|
19
|
+
}))
|
|
20
|
+
.filter(hasValue)
|
|
21
|
+
.reduce((result, { name, parsedName, value, parsedValue }) => {
|
|
22
|
+
if (name.length > 1) {
|
|
23
|
+
result.push(`--${parsedName}`);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
result.push(`-${parsedName}`);
|
|
27
|
+
}
|
|
28
|
+
value.toString();
|
|
29
|
+
if (value !== true) {
|
|
30
|
+
let v = parsedValue;
|
|
31
|
+
if (v.length > 2 &&
|
|
32
|
+
v[0] === '"' &&
|
|
33
|
+
v[v.length - 1] === '"' &&
|
|
34
|
+
!v.includes(" "))
|
|
35
|
+
v = v.slice(1, -1);
|
|
36
|
+
result.push(v);
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}, []);
|
|
40
|
+
};
|
|
41
|
+
exports.parseArgs = parseArgs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseBashArgs.d.ts","sourceRoot":"","sources":["../../../../src/scripts/cmd/parseBashArgs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAGpC,eAAO,MAAM,aAAa,GACxB,MAAM,MAAM,EACZ,OAAO,IAAI,EACX,WAAW,OAAO,aAanB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseBashArgs = void 0;
|
|
4
|
+
const log_1 = require("./log");
|
|
5
|
+
const parseArgs_1 = require("./parseArgs");
|
|
6
|
+
const parseBashArgs = (path, args, absolute) => {
|
|
7
|
+
const filePath = path.endsWith('.sh') ? path : `${path}.sh`;
|
|
8
|
+
const absolutePath = !absolute ? `${__dirname}/../${filePath}` : filePath;
|
|
9
|
+
const flags = [absolutePath];
|
|
10
|
+
if (args) {
|
|
11
|
+
flags.push(...(0, parseArgs_1.parseArgs)(args));
|
|
12
|
+
}
|
|
13
|
+
log_1.log.verbose('executeBash:', flags.join(' '));
|
|
14
|
+
return flags;
|
|
15
|
+
};
|
|
16
|
+
exports.parseBashArgs = parseBashArgs;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ArgValue = string | number | boolean;
|
|
2
|
+
export type Args = Record<string, ArgValue | undefined> | {};
|
|
3
|
+
export interface ParsedArg {
|
|
4
|
+
name: string;
|
|
5
|
+
parsedName: string;
|
|
6
|
+
value: ArgValue | undefined;
|
|
7
|
+
parsedValue: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export type NotNullableProps<T> = {
|
|
10
|
+
[K in keyof T]: NonNullable<T[K]>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/scripts/cmd/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AACjD,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC;AAE7D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;KAC/B,CAAC,IAAI,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FileInfoUpdate } from "./copyFiles";
|
|
2
|
+
/**
|
|
3
|
+
* Function that copies all files recursively from one dir to another allowing to update their content in the process.
|
|
4
|
+
* @param sourcePath Directory of files to copy recursively.
|
|
5
|
+
* @param destinationPath Destination directory to place files.
|
|
6
|
+
* @param updateContent Optional function that updates the contents of each file.
|
|
7
|
+
*/
|
|
8
|
+
export declare const copyDir: (sourcePath: string, destinationPath: string, updateFile?: FileInfoUpdate) => Promise<void>;
|
|
9
|
+
//# sourceMappingURL=copyDir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyDir.d.ts","sourceRoot":"","sources":["../../../../src/scripts/filesystem/copyDir.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,cAAc,EAAE,MAAM,aAAa,CAAC;AAGxD;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAClB,YAAY,MAAM,EAClB,iBAAiB,MAAM,EACvB,aAAa,cAAc,kBAe5B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.copyDir = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const copyFiles_1 = require("./copyFiles");
|
|
6
|
+
const log_1 = require("./log");
|
|
7
|
+
/**
|
|
8
|
+
* Function that copies all files recursively from one dir to another allowing to update their content in the process.
|
|
9
|
+
* @param sourcePath Directory of files to copy recursively.
|
|
10
|
+
* @param destinationPath Destination directory to place files.
|
|
11
|
+
* @param updateContent Optional function that updates the contents of each file.
|
|
12
|
+
*/
|
|
13
|
+
const copyDir = (sourcePath, destinationPath, updateFile) => {
|
|
14
|
+
log_1.log.verbose("copyDir", { sourcePath, destinationPath });
|
|
15
|
+
const glob = (0, path_1.join)(sourcePath, "**", "*.*");
|
|
16
|
+
return (0, copyFiles_1.copyFiles)([glob], (file) => {
|
|
17
|
+
const newDir = (0, path_1.join)(destinationPath, (0, path_1.relative)(sourcePath, file.dir));
|
|
18
|
+
log_1.log.verbose("copyDir file from", file.dir, "to", newDir);
|
|
19
|
+
const f = updateFile ? updateFile(file) : file;
|
|
20
|
+
return {
|
|
21
|
+
...f,
|
|
22
|
+
dir: newDir,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
exports.copyDir = copyDir;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ParsedPath } from "path";
|
|
2
|
+
export interface FileInfo extends Omit<ParsedPath, "root"> {
|
|
3
|
+
name: string;
|
|
4
|
+
content: string;
|
|
5
|
+
encoding: BufferEncoding;
|
|
6
|
+
}
|
|
7
|
+
export type FileInfoUpdate = (fileInfo: FileInfo) => Partial<FileInfo>;
|
|
8
|
+
export declare const loadFiles: (globs: string[]) => Promise<FileInfo[]>;
|
|
9
|
+
export declare const updateFiles: (files: FileInfo[], update: FileInfoUpdate) => FileInfo[];
|
|
10
|
+
export declare const copyFiles: (globs: string[], update: FileInfoUpdate) => Promise<void>;
|
|
11
|
+
//# sourceMappingURL=copyFiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyFiles.d.ts","sourceRoot":"","sources":["../../../../src/scripts/filesystem/copyFiles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAA0B,MAAM,MAAM,CAAC;AAI/D,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvE,eAAO,MAAM,SAAS,GAAU,OAAO,MAAM,EAAE,KAAG,OAAO,CAAC,QAAQ,EAAE,CAsBnE,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,OAAO,QAAQ,EAAE,EACjB,QAAQ,cAAc,KACrB,QAAQ,EASV,CAAC;AAoBF,eAAO,MAAM,SAAS,GAAU,OAAO,MAAM,EAAE,EAAE,QAAQ,cAAc,kBAItE,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.copyFiles = exports.updateFiles = exports.loadFiles = void 0;
|
|
4
|
+
const promises_1 = require("fs/promises");
|
|
5
|
+
const glob_1 = require("glob");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const fs_extra_1 = require("fs-extra");
|
|
8
|
+
const log_1 = require("./log");
|
|
9
|
+
const loadFiles = async (globs) => {
|
|
10
|
+
const { isText } = await import("istextorbinary");
|
|
11
|
+
log_1.log.verbose("Globs:", globs);
|
|
12
|
+
const filePaths = await (0, glob_1.glob)(globs, {
|
|
13
|
+
nodir: true,
|
|
14
|
+
dot: true,
|
|
15
|
+
nocase: true,
|
|
16
|
+
});
|
|
17
|
+
log_1.log.verbose("Loaded files:", filePaths.length);
|
|
18
|
+
const files = filePaths.map(async (path) => {
|
|
19
|
+
const encoding = isText(path) ? "utf-8" : "binary";
|
|
20
|
+
return {
|
|
21
|
+
...(0, path_1.parse)(path),
|
|
22
|
+
content: await (0, promises_1.readFile)(path, encoding),
|
|
23
|
+
encoding,
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
return Promise.all(files);
|
|
27
|
+
};
|
|
28
|
+
exports.loadFiles = loadFiles;
|
|
29
|
+
const updateFiles = (files, update) => {
|
|
30
|
+
return files.map((original) => {
|
|
31
|
+
log_1.log.verbose("Updating file", original.dir, original.base);
|
|
32
|
+
const updated = update(original);
|
|
33
|
+
return {
|
|
34
|
+
...original,
|
|
35
|
+
...updated,
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
exports.updateFiles = updateFiles;
|
|
40
|
+
const getPath = (relative) => (0, path_1.resolve)(process.cwd(), relative);
|
|
41
|
+
const write = async (files) => {
|
|
42
|
+
const writes = files.map(async (file) => {
|
|
43
|
+
const dirPath = getPath(file.dir);
|
|
44
|
+
const dirExists = await (0, fs_extra_1.exists)(dirPath);
|
|
45
|
+
if (!dirExists) {
|
|
46
|
+
await (0, promises_1.mkdir)(dirPath, { recursive: true });
|
|
47
|
+
}
|
|
48
|
+
const filePath = getPath((0, path_1.format)(file));
|
|
49
|
+
log_1.log.verbose("Writing file", filePath);
|
|
50
|
+
await (0, promises_1.writeFile)(filePath, file.content, file.encoding);
|
|
51
|
+
});
|
|
52
|
+
await Promise.all(writes);
|
|
53
|
+
};
|
|
54
|
+
const copyFiles = async (globs, update) => {
|
|
55
|
+
const files = await (0, exports.loadFiles)(globs);
|
|
56
|
+
const updatedFiles = (0, exports.updateFiles)(files, update);
|
|
57
|
+
await write(updatedFiles);
|
|
58
|
+
};
|
|
59
|
+
exports.copyFiles = copyFiles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findFile.d.ts","sourceRoot":"","sources":["../../../../src/scripts/filesystem/findFile.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,QAAQ,GACnB,UAAU,MAAM,EAChB,MAAK,MAAsB,KAC1B,MAAM,GAAG,IAGX,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findFile = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const log_1 = require("./log");
|
|
7
|
+
const searchFile = (fileName, dir) => {
|
|
8
|
+
const filePath = (0, path_1.join)(dir, fileName);
|
|
9
|
+
if ((0, fs_1.existsSync)(filePath)) {
|
|
10
|
+
log_1.log.verbose('Found file:', filePath);
|
|
11
|
+
return filePath;
|
|
12
|
+
}
|
|
13
|
+
const parent = (0, path_1.join)(dir, '..');
|
|
14
|
+
if (parent === dir || !(0, fs_1.existsSync)(parent)) {
|
|
15
|
+
log_1.log.verbose('File not found:', fileName);
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return searchFile(fileName, parent);
|
|
19
|
+
};
|
|
20
|
+
const findFile = (fileName, dir = process.cwd()) => {
|
|
21
|
+
log_1.log.verbose('Looking for file:', fileName);
|
|
22
|
+
return searchFile(fileName, dir);
|
|
23
|
+
};
|
|
24
|
+
exports.findFile = findFile;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const filesystem: {
|
|
2
|
+
copyDir: (sourcePath: string, destinationPath: string, updateFile?: import("./copyFiles").FileInfoUpdate) => Promise<void>;
|
|
3
|
+
copyFiles: (globs: string[], update: import("./copyFiles").FileInfoUpdate) => Promise<void>;
|
|
4
|
+
loadFiles: (globs: string[]) => Promise<import("./copyFiles").FileInfo[]>;
|
|
5
|
+
updateFiles: (files: import("./copyFiles").FileInfo[], update: import("./copyFiles").FileInfoUpdate) => import("./copyFiles").FileInfo[];
|
|
6
|
+
readDirRecursive: (dirPath: string) => string[];
|
|
7
|
+
loadJsonFile: <T>(filePath: string) => T | null;
|
|
8
|
+
findFile: (fileName: string, dir?: string) => string | null;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/scripts/filesystem/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU;;;;;;;;CAQtB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filesystem = void 0;
|
|
4
|
+
const copyDir_1 = require("./copyDir");
|
|
5
|
+
const readDirRecursive_1 = require("./readDirRecursive");
|
|
6
|
+
const loadJsonFile_1 = require("./loadJsonFile");
|
|
7
|
+
const findFile_1 = require("./findFile");
|
|
8
|
+
const copyFiles_1 = require("./copyFiles");
|
|
9
|
+
exports.filesystem = {
|
|
10
|
+
copyDir: copyDir_1.copyDir,
|
|
11
|
+
copyFiles: copyFiles_1.copyFiles,
|
|
12
|
+
loadFiles: copyFiles_1.loadFiles,
|
|
13
|
+
updateFiles: copyFiles_1.updateFiles,
|
|
14
|
+
readDirRecursive: readDirRecursive_1.readDirRecursive,
|
|
15
|
+
loadJsonFile: loadJsonFile_1.loadJsonFile,
|
|
16
|
+
findFile: findFile_1.findFile,
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadJsonFile.d.ts","sourceRoot":"","sources":["../../../../src/scripts/filesystem/loadJsonFile.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,UAAU,MAAM,KAAG,CAAC,GAAG,IAatD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadJsonFile = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const log_1 = require("./log");
|
|
6
|
+
const loadJsonFile = (filePath) => {
|
|
7
|
+
log_1.log.verbose('Try to load JSON file:', filePath);
|
|
8
|
+
const invalidPath = !filePath || !(0, fs_1.existsSync)(filePath);
|
|
9
|
+
if (invalidPath) {
|
|
10
|
+
log_1.log.verbose('Invalid file path:', filePath);
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const json = (0, fs_1.readFileSync)(filePath).toString();
|
|
14
|
+
const result = JSON.parse(json);
|
|
15
|
+
log_1.log.verbose('Successfully loaded JSON file:', filePath);
|
|
16
|
+
return result;
|
|
17
|
+
};
|
|
18
|
+
exports.loadJsonFile = loadJsonFile;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../../src/scripts/filesystem/log.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,4BAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readDirRecursive.d.ts","sourceRoot":"","sources":["../../../../src/scripts/filesystem/readDirRecursive.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,MAAM,EAC/B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readDirRecursive = void 0;
|
|
4
|
+
const fs_extra_1 = require("fs-extra");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const readDirStep = (absoluteDirPath, relativeDirPath) => (0, fs_extra_1.readdirSync)(absoluteDirPath).reduce((result, current) => {
|
|
7
|
+
const absPath = (0, path_1.resolve)(absoluteDirPath, current);
|
|
8
|
+
const relPath = (0, path_1.join)(relativeDirPath, current);
|
|
9
|
+
const isDirectory = (0, fs_extra_1.statSync)(absPath).isDirectory();
|
|
10
|
+
if (isDirectory) {
|
|
11
|
+
return [...result, ...readDirStep(absPath, relPath)];
|
|
12
|
+
}
|
|
13
|
+
return [...result, relPath];
|
|
14
|
+
}, []);
|
|
15
|
+
const readDirRecursive = (dirPath) => readDirStep(dirPath, '');
|
|
16
|
+
exports.readDirRecursive = readDirRecursive;
|