@gluhar/cli 2.0.0-dev.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 +46 -0
- 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 +4 -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 +23 -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 +9 -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/generate/GenerateOptions.d.ts +8 -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 +82 -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 +13 -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 +21 -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 +9 -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 +22 -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 +18 -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 +21 -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 +90 -0
- package/src/commands/version/VersionOptions.d.ts +7 -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 +32 -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 +55 -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.d.ts +10 -0
- 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/getBashOutput.d.ts +10 -0
- 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.d.ts +8 -0
- package/src/scripts/cmd/index.d.ts.map +1 -0
- package/src/scripts/cmd/index.js +25 -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/commit.sh +1 -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 +28 -0
- package/src/scripts/git/index.d.ts.map +1 -0
- package/src/scripts/git/index.js +38 -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/list.sh +1 -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 +1 -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 +2 -0
- 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 +2 -0
- package/src/utils/common.d.ts.map +1 -0
- package/src/utils/common.js +5 -0
- package/src/utils/index.d.ts +4 -0
- 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
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateProject = void 0;
|
|
4
|
+
const filesystem_1 = require("../../scripts/filesystem");
|
|
5
|
+
const log_1 = require("./log");
|
|
6
|
+
const cmd_1 = require("../../scripts/cmd");
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
8
|
+
const generateProject = async (name, cwd, options) => {
|
|
9
|
+
const { noRepo, keepHistory, yes } = options;
|
|
10
|
+
log_1.log.verbose("Check if project name is valid");
|
|
11
|
+
if (!name.match(/^[a-z0-9-]+$/)) {
|
|
12
|
+
log_1.log.error("Project name must be lowercase, alphanumeric, and contain hyphens only.");
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (!noRepo) {
|
|
16
|
+
// Check if gh is installed
|
|
17
|
+
if ((0, cmd_1.executeCmd)("gh --version").status !== 0) {
|
|
18
|
+
const installGh = await (0, utils_1.confirmQuestion)("GitHub cli is not installed. Do you want to install it now? (brew install gh)", yes);
|
|
19
|
+
if (installGh) {
|
|
20
|
+
(0, cmd_1.executeCmd)("brew install gh");
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
log_1.log.error("You must have GitHub cli installed to generate a project and create a repo.");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// Check if gh user is authenticated
|
|
28
|
+
if ((0, cmd_1.executeCmd)("gh auth status").status !== 0) {
|
|
29
|
+
const authenticateGh = await (0, utils_1.confirmQuestion)("GitHub cli is not authenticated. Do you want to authenticate now? (gh auth login)", yes);
|
|
30
|
+
if (authenticateGh) {
|
|
31
|
+
(0, cmd_1.executeCmd)("gh auth login");
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
log_1.log.error("You must authenticate with GitHub cli before generating a project in order to create the repo.");
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
log_1.log.verbose("Skipping gh verification");
|
|
41
|
+
}
|
|
42
|
+
log_1.log.verbose("Cloning gluhar project template");
|
|
43
|
+
(0, cmd_1.executeCmd)(`git clone --branch hui https://github.com/gluharry/starters.git ${name}`); // TODO create a git.clone; TODO allow other branches; TODO change hui to gluhar
|
|
44
|
+
cmd_1.cmd.cd(name);
|
|
45
|
+
log_1.log.verbose("Replacing hui-app with project's name");
|
|
46
|
+
await filesystem_1.filesystem.copyFiles([
|
|
47
|
+
"./package.json",
|
|
48
|
+
"./README.md",
|
|
49
|
+
"./nuxt.config.ts",
|
|
50
|
+
"./sanity/sanity.config.ts",
|
|
51
|
+
"./sanity/structure.ts",
|
|
52
|
+
], (file) => {
|
|
53
|
+
const content = file.content.replaceAll("hui-app", name);
|
|
54
|
+
return {
|
|
55
|
+
...file,
|
|
56
|
+
content,
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
if (!keepHistory) {
|
|
60
|
+
log_1.log.verbose("Removing git history");
|
|
61
|
+
(0, cmd_1.executeCmd)("rm -rf .git");
|
|
62
|
+
log_1.log.verbose("Initializing empty git repo with initial flat commit");
|
|
63
|
+
(0, cmd_1.executeCmd)("git init --initial-branch=dev && git add . && git commit -m 'Initial commit'");
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
log_1.log.verbose("Keeping git history and removing remote origin");
|
|
67
|
+
(0, cmd_1.executeCmd)("git remote remove origin && git branch -m dev");
|
|
68
|
+
}
|
|
69
|
+
if (!noRepo) {
|
|
70
|
+
log_1.log.verbose("Creating new github remote repo");
|
|
71
|
+
(0, cmd_1.executeCmd)(`gh repo create ${name} --private --source=. --push`);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
log_1.log.verbose("Skipping repo creation and deleting .git. You are on your own.");
|
|
75
|
+
(0, cmd_1.executeCmd)("rm -rf .git");
|
|
76
|
+
}
|
|
77
|
+
const openCode = await (0, utils_1.confirmQuestion)(`Project '${name}' was created successfully! Do you want to open it in VSCode?`, yes);
|
|
78
|
+
if (openCode) {
|
|
79
|
+
(0, cmd_1.executeCmd)("code . -g README.md");
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
exports.generateProject = generateProject;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;;AAIpC,wBAUoB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const commander_1 = require("commander");
|
|
4
|
+
const generate_1 = require("./generate");
|
|
5
|
+
const GenerateOptions_1 = require("./GenerateOptions");
|
|
6
|
+
exports.default = new commander_1.Command()
|
|
7
|
+
.name("generate")
|
|
8
|
+
.argument("<type>", "What to generate.")
|
|
9
|
+
.argument("<name>", "Name of generated thing.")
|
|
10
|
+
.description(`Generate a ${GenerateOptions_1.generateTypes.join(", ")}.`)
|
|
11
|
+
.option("-nr, --no-repo", "Do not create a github repo automatically.")
|
|
12
|
+
.option("-kh, --keep-history", "Keep commit history from the starter template.")
|
|
13
|
+
.action(generate_1.generate);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/log.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,4BAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":";AAQA,wBAQE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
const build_1 = __importDefault(require("./build"));
|
|
7
|
+
const deinstall_1 = __importDefault(require("./deinstall"));
|
|
8
|
+
const deploy_1 = __importDefault(require("./deploy"));
|
|
9
|
+
const generate_1 = __importDefault(require("./generate"));
|
|
10
|
+
const reinstall_1 = __importDefault(require("./reinstall"));
|
|
11
|
+
const release_1 = __importDefault(require("./release"));
|
|
12
|
+
const version_1 = __importDefault(require("./version"));
|
|
13
|
+
exports.default = [
|
|
14
|
+
deploy_1.default,
|
|
15
|
+
version_1.default,
|
|
16
|
+
release_1.default,
|
|
17
|
+
build_1.default,
|
|
18
|
+
deinstall_1.default,
|
|
19
|
+
reinstall_1.default,
|
|
20
|
+
generate_1.default,
|
|
21
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KissOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/kiss/KissOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/kiss/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;;AAGpC,wBAIgB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const commander_1 = require("commander");
|
|
4
|
+
const kiss_1 = require("./kiss");
|
|
5
|
+
exports.default = new commander_1.Command()
|
|
6
|
+
.name("kiss")
|
|
7
|
+
.description("Description of command.")
|
|
8
|
+
.option("-b, --kiss", "A boolean option.")
|
|
9
|
+
.action(kiss_1.kiss);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kiss.d.ts","sourceRoot":"","sources":["../../../../src/commands/kiss/kiss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,eAAO,MAAM,IAAI,YAAa,WAAW,SAExC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../../src/commands/kiss/log.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,4BAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReinstallOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/reinstall/ReinstallOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/reinstall/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;;AAGpC,wBAOqB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const commander_1 = require("commander");
|
|
4
|
+
const reinstall_1 = require("./reinstall");
|
|
5
|
+
exports.default = new commander_1.Command()
|
|
6
|
+
.name("reinstall")
|
|
7
|
+
.description("Reinstall npm dependencies with a fresh package-lock.json.")
|
|
8
|
+
.option("-p, --packages", "Reinstall dependencies in when using multiple packages (monorepo).")
|
|
9
|
+
.action(reinstall_1.reinstall);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../../src/commands/reinstall/log.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,4BAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reinstall.d.ts","sourceRoot":"","sources":["../../../../src/commands/reinstall/reinstall.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,eAAO,MAAM,SAAS,YAAa,gBAAgB,SAOlD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reinstall = void 0;
|
|
4
|
+
const cmd_1 = require("../../scripts/cmd");
|
|
5
|
+
const log_1 = require("./log");
|
|
6
|
+
const deinstall_1 = require("../deinstall/deinstall");
|
|
7
|
+
const reinstall = (options) => {
|
|
8
|
+
// Run deinstall first
|
|
9
|
+
(0, deinstall_1.deinstall)(options);
|
|
10
|
+
// Install dependencies
|
|
11
|
+
log_1.log.info("Reinstalling packages.");
|
|
12
|
+
(0, cmd_1.executeCmd)("npm install");
|
|
13
|
+
};
|
|
14
|
+
exports.reinstall = reinstall;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReleaseOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/release/ReleaseOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC;IACtB,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/release/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;;AAIpC,wBAmCmB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const commander_1 = require("commander");
|
|
4
|
+
const release_1 = require("./release");
|
|
5
|
+
const tag_1 = require("./tag");
|
|
6
|
+
exports.default = new commander_1.Command()
|
|
7
|
+
.name("release")
|
|
8
|
+
.description("Release and publish packages to the npm registry.")
|
|
9
|
+
.option("-y, --yes", "When run with this flag, we will skip all confirmation prompts. NOTE does not currently work.", false)
|
|
10
|
+
.option("--pre [id]", "Prerelease identifier. Use this when releasing a prerelease version.", false)
|
|
11
|
+
.option("-d, --dev", "Release a dev version. This is a shorthand for a prerelease with a 'dev' identifier.", false)
|
|
12
|
+
.option("--dir, --directory <path>", "Subdirectory to publish. Must apply to ALL packages, and MUST contain a package.json file.", "dist")
|
|
13
|
+
.option("--no-version", "Disable versioning and changelog gen.")
|
|
14
|
+
.option("--git-tag [tag]", [
|
|
15
|
+
"Create and push git tag(s). Optionally provide a template.",
|
|
16
|
+
"Template placeholders:",
|
|
17
|
+
`"${tag_1.pattern.fullPackageName}" (full package name, e.g. "@gluhar/cli"),`,
|
|
18
|
+
`"${tag_1.pattern.shortPackageName}" (short package name, e.g. "cli"),`,
|
|
19
|
+
`"${tag_1.pattern.version}" (released package version, e.g. "1.2.3").`,
|
|
20
|
+
`When set to "true" defaults to: "${tag_1.pattern.default.independent}" for independent versioning and "${tag_1.pattern.default.fixed}" for fixed.`,
|
|
21
|
+
].join("\n"))
|
|
22
|
+
.action(release_1.release);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../../src/commands/release/log.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,4BAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../../src/commands/release/publish.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIvD,eAAO,MAAM,OAAO,YAAa,cAAc,SAY9C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.publish = void 0;
|
|
4
|
+
const lerna_1 = require("../../scripts/lerna");
|
|
5
|
+
const log_1 = require("./log");
|
|
6
|
+
const getPreid_1 = require("../version/getPreid");
|
|
7
|
+
const publish = (options) => {
|
|
8
|
+
const { yes, pre, dev, directory } = options;
|
|
9
|
+
const distTag = dev ? "dev" : (0, getPreid_1.getPreid)(pre) ?? "latest";
|
|
10
|
+
log_1.log.info("Dist tag:", distTag);
|
|
11
|
+
log_1.log.info("Directory:", directory);
|
|
12
|
+
lerna_1.lerna.publish({
|
|
13
|
+
distTag,
|
|
14
|
+
contents: directory,
|
|
15
|
+
yes,
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
exports.publish = publish;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../../src/commands/release/release.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKvD,eAAO,MAAM,OAAO,YAAmB,cAAc,kBAepD,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.release = void 0;
|
|
4
|
+
const version_1 = require("../version/version");
|
|
5
|
+
const log_1 = require("./log");
|
|
6
|
+
const publish_1 = require("./publish");
|
|
7
|
+
const tag_1 = require("./tag");
|
|
8
|
+
const release = async (options) => {
|
|
9
|
+
log_1.log.info("Initiating release...");
|
|
10
|
+
const { pre, dev } = options;
|
|
11
|
+
if (options.version)
|
|
12
|
+
await (0, version_1.version)({
|
|
13
|
+
pre,
|
|
14
|
+
dev,
|
|
15
|
+
changelog: !dev,
|
|
16
|
+
commit: "chore: Releasing gluhar packages.",
|
|
17
|
+
});
|
|
18
|
+
(0, publish_1.publish)(options);
|
|
19
|
+
await (0, tag_1.tag)(options);
|
|
20
|
+
};
|
|
21
|
+
exports.release = release;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReleaseOptions } from "./ReleaseOptions";
|
|
2
|
+
export declare const pattern: {
|
|
3
|
+
/** e.g. `@gluhar/cli` */
|
|
4
|
+
fullPackageName: string;
|
|
5
|
+
/** e.g. `cli` */
|
|
6
|
+
shortPackageName: string;
|
|
7
|
+
/** e.g. `1.2.3` */
|
|
8
|
+
version: string;
|
|
9
|
+
default: {
|
|
10
|
+
/** e.g. `cli/v1.2.3` */
|
|
11
|
+
independent: string;
|
|
12
|
+
/** e.g. `v1.2.3` */
|
|
13
|
+
fixed: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export interface PackageInfo {
|
|
17
|
+
/** Required for independent versioning. */
|
|
18
|
+
name?: string;
|
|
19
|
+
version: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const parsePattern: (tagPattern: string, pkg: PackageInfo) => string;
|
|
22
|
+
export declare const tag: (options: ReleaseOptions) => Promise<void>;
|
|
23
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/commands/release/tag.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,eAAO,MAAM,OAAO;IAClB,yBAAyB;;IAEzB,iBAAiB;;IAEjB,mBAAmB;;;QAGjB,wBAAwB;;QAExB,oBAAoB;;;CAGvB,CAAC;AAiBF,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,eAAgB,MAAM,OAAO,WAAW,KAAG,MAyBnE,CAAC;AAEF,eAAO,MAAM,GAAG,YAAmB,cAAc,kBAgDhD,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tag = exports.parsePattern = exports.pattern = void 0;
|
|
4
|
+
const lerna_1 = require("../../scripts/lerna");
|
|
5
|
+
const constants_1 = require("../../scripts/lerna/constants");
|
|
6
|
+
const git_1 = require("../../scripts/git");
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
8
|
+
const log_1 = require("./log");
|
|
9
|
+
exports.pattern = {
|
|
10
|
+
/** e.g. `@gluhar/cli` */
|
|
11
|
+
fullPackageName: "%f",
|
|
12
|
+
/** e.g. `cli` */
|
|
13
|
+
shortPackageName: "%s",
|
|
14
|
+
/** e.g. `1.2.3` */
|
|
15
|
+
version: "%v",
|
|
16
|
+
default: {
|
|
17
|
+
/** e.g. `cli/v1.2.3` */
|
|
18
|
+
independent: "%f@%v",
|
|
19
|
+
/** e.g. `v1.2.3` */
|
|
20
|
+
fixed: "v%v",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
const getGitTagPattern = (gitTag, isIndependent) => {
|
|
24
|
+
if (typeof gitTag === "string") {
|
|
25
|
+
return gitTag;
|
|
26
|
+
}
|
|
27
|
+
if (!gitTag) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return isIndependent ? exports.pattern.default.independent : exports.pattern.default.fixed;
|
|
31
|
+
};
|
|
32
|
+
const parsePattern = (tagPattern, pkg) => {
|
|
33
|
+
const { name: fullName, version } = pkg;
|
|
34
|
+
const placeholders = [
|
|
35
|
+
{
|
|
36
|
+
pattern: exports.pattern.version,
|
|
37
|
+
value: version,
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
if (fullName) {
|
|
41
|
+
const shortName = fullName.substring(fullName.indexOf("/") + 1);
|
|
42
|
+
placeholders.push({
|
|
43
|
+
pattern: exports.pattern.fullPackageName,
|
|
44
|
+
value: fullName,
|
|
45
|
+
});
|
|
46
|
+
placeholders.push({
|
|
47
|
+
pattern: exports.pattern.shortPackageName,
|
|
48
|
+
value: shortName,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return placeholders.reduce((t, ph) => t.replaceAll(ph.pattern, ph.value), tagPattern);
|
|
52
|
+
};
|
|
53
|
+
exports.parsePattern = parsePattern;
|
|
54
|
+
const tag = async (options) => {
|
|
55
|
+
const { gitTag, yes } = options;
|
|
56
|
+
if (!gitTag) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const lernaConfig = lerna_1.lerna.getConfig();
|
|
60
|
+
const isIndependent = !!lernaConfig && lernaConfig.version === constants_1.INDEPENDENT_VERSION;
|
|
61
|
+
const tagPattern = getGitTagPattern(gitTag, isIndependent);
|
|
62
|
+
if (!tagPattern) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const tags = new Set();
|
|
66
|
+
if (!lernaConfig ||
|
|
67
|
+
isIndependent ||
|
|
68
|
+
tagPattern.includes(exports.pattern.fullPackageName) ||
|
|
69
|
+
tagPattern.includes(exports.pattern.shortPackageName)) {
|
|
70
|
+
lerna_1.lerna
|
|
71
|
+
.changed()
|
|
72
|
+
.filter((pkg) => !pkg.private)
|
|
73
|
+
.map((pkg) => (0, exports.parsePattern)(tagPattern, pkg))
|
|
74
|
+
.forEach((t) => tags.add(t));
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
const t = (0, exports.parsePattern)(tagPattern, { version: lernaConfig.version });
|
|
78
|
+
tags.add(t);
|
|
79
|
+
}
|
|
80
|
+
const tagList = [...tags].map((t) => `\n - ${t}`).join("");
|
|
81
|
+
log_1.log.verbose("Tags to create:", tagList);
|
|
82
|
+
const confirm = await (0, utils_1.confirmQuestion)(`Create and push tag(s): ${tagList}. Confirm?`, yes);
|
|
83
|
+
if (confirm) {
|
|
84
|
+
tags.forEach((t) => {
|
|
85
|
+
git_1.git.tag.create(t);
|
|
86
|
+
});
|
|
87
|
+
git_1.git.tag.pushAll();
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
exports.tag = tag;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VersionOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/version/VersionOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC;IACtB,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPreid.d.ts","sourceRoot":"","sources":["../../../../src/commands/version/getPreid.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,QAAS,OAAO,GAAG,MAAM,uBAM7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/version/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;;AAGpC,wBAcmB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const commander_1 = require("commander");
|
|
4
|
+
const version_1 = require("./version");
|
|
5
|
+
exports.default = new commander_1.Command()
|
|
6
|
+
.name("version")
|
|
7
|
+
.description("Update package versions and generate change logs.")
|
|
8
|
+
.option("--pre [id]", "Prerelease identifier. Use this when creating a prerelease versioning.", false)
|
|
9
|
+
.option("-d, --dev", "Release a dev version. This is a shorthand for a prerelease with a 'dev' identifier.")
|
|
10
|
+
.option("--no-changelog", "Disable generating changelogs.")
|
|
11
|
+
.option("-c, --commit [msg]", "Commit changes in git.", false)
|
|
12
|
+
.action(version_1.version);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../../src/commands/version/log.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,4BAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pimpChangelogs.d.ts","sourceRoot":"","sources":["../../../../src/commands/version/pimpChangelogs.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,qBAoC1B,CAAC"}
|