Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
di-sukharev committed Sep 1, 2024
1 parent 4387c12 commit 23a8d76
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 35 deletions.
43 changes: 25 additions & 18 deletions out/cli.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27752,6 +27752,7 @@ var CONFIG_KEYS = /* @__PURE__ */ ((CONFIG_KEYS2) => {
CONFIG_KEYS2["OCO_EMOJI"] = "OCO_EMOJI";
CONFIG_KEYS2["OCO_MODEL"] = "OCO_MODEL";
CONFIG_KEYS2["OCO_LANGUAGE"] = "OCO_LANGUAGE";
CONFIG_KEYS2["OCO_WHY"] = "OCO_WHY";
CONFIG_KEYS2["OCO_MESSAGE_TEMPLATE_PLACEHOLDER"] = "OCO_MESSAGE_TEMPLATE_PLACEHOLDER";
CONFIG_KEYS2["OCO_PROMPT_MODULE"] = "OCO_PROMPT_MODULE";
CONFIG_KEYS2["OCO_AI_PROVIDER"] = "OCO_AI_PROVIDER";
Expand Down Expand Up @@ -28042,6 +28043,7 @@ var DEFAULT_CONFIG = {
OCO_ONE_LINE_COMMIT: false,
OCO_TEST_MOCK_TYPE: "commit-message",
OCO_FLOWISE_ENDPOINT: ":",
OCO_WHY: false,
OCO_GITPUSH: true
};
var initGlobalConfig = (configPath = defaultConfigPath) => {
Expand Down Expand Up @@ -42568,7 +42570,7 @@ Example Git Diff is to follow:`
];
var INIT_MAIN_PROMPT = (language, prompts) => ({
role: "system",
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes ${config2.OCO_WHY ? "and WHY the changes were done" : ""}. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
${config2.OCO_EMOJI ? "Use GitMoji convention to preface the commit." : "Do not preface the commit with anything."}
${config2.OCO_DESCRIPTION ? `Add a short description of WHY the changes are done after the commit message. Don't start it with "This commit", just describe the changes.` : "Don't add any descriptions to the commit, only commit message."}
Use the present tense. Use ${language} to answer.
Expand All @@ -42588,34 +42590,39 @@ var commitlintPrompts = {
// src/modules/commitlint/pwd-commitlint.ts
var import_promises = __toESM(require("fs/promises"), 1);
var import_path3 = __toESM(require("path"), 1);
var findModulePath = (moduleName) => {
const searchPaths = [
import_path3.default.join("node_modules", moduleName),
import_path3.default.join("node_modules", ".pnpm")
];
for (const basePath of searchPaths) {
try {
const resolvedPath = require.resolve(moduleName, { paths: [basePath] });
return resolvedPath;
} catch {
}
}
throw new Error(`Cannot find module ${moduleName}`);
};
var getCommitLintModuleType = async () => {
const packageFile = "node_modules/@commitlint/load/package.json";
const packageJsonPath = import_path3.default.join(
process.env.PWD || process.cwd(),
packageFile
);
const packageFile = "@commitlint/load/package.json";
const packageJsonPath = findModulePath(packageFile);
const packageJson = JSON.parse(await import_promises.default.readFile(packageJsonPath, "utf8"));
if (!packageJson) {
throw new Error(`Failed to parse ${packageFile}`);
}
return packageJson.type === "module" ? "esm" : "cjs";
};
var getCommitLintPWDConfig = async () => {
let load, nodeModulesPath;
let load, modulePath;
switch (await getCommitLintModuleType()) {
case "cjs":
nodeModulesPath = import_path3.default.join(
process.env.PWD || process.cwd(),
"node_modules/@commitlint/load"
);
load = require(nodeModulesPath).default;
modulePath = findModulePath("@commitlint/load");
load = require(modulePath).default;
break;
case "esm":
nodeModulesPath = import_path3.default.join(
process.env.PWD || process.cwd(),
"node_modules/@commitlint/load/lib/load.js"
);
load = (await import(nodeModulesPath)).default;
modulePath = await findModulePath("@commitlint/load/lib/load.js");
load = (await import(modulePath)).default;
break;
}
if (load && typeof load === "function") {
Expand Down Expand Up @@ -43350,7 +43357,7 @@ var commitlintConfigCommand = G3(
const { mode } = argv._;
if (mode === "get" /* get */) {
const commitLintConfig = await getCommitlintLLMConfig();
ce(commitLintConfig.toString());
ce(JSON.stringify(commitLintConfig, null, 2));
return;
}
if (mode === "force" /* force */) {
Expand Down
41 changes: 24 additions & 17 deletions out/github-action.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -46564,6 +46564,7 @@ var CONFIG_KEYS = /* @__PURE__ */ ((CONFIG_KEYS2) => {
CONFIG_KEYS2["OCO_EMOJI"] = "OCO_EMOJI";
CONFIG_KEYS2["OCO_MODEL"] = "OCO_MODEL";
CONFIG_KEYS2["OCO_LANGUAGE"] = "OCO_LANGUAGE";
CONFIG_KEYS2["OCO_WHY"] = "OCO_WHY";
CONFIG_KEYS2["OCO_MESSAGE_TEMPLATE_PLACEHOLDER"] = "OCO_MESSAGE_TEMPLATE_PLACEHOLDER";
CONFIG_KEYS2["OCO_PROMPT_MODULE"] = "OCO_PROMPT_MODULE";
CONFIG_KEYS2["OCO_AI_PROVIDER"] = "OCO_AI_PROVIDER";
Expand Down Expand Up @@ -46854,6 +46855,7 @@ var DEFAULT_CONFIG = {
OCO_ONE_LINE_COMMIT: false,
OCO_TEST_MOCK_TYPE: "commit-message",
OCO_FLOWISE_ENDPOINT: ":",
OCO_WHY: false,
OCO_GITPUSH: true
};
var initGlobalConfig = (configPath = defaultConfigPath) => {
Expand Down Expand Up @@ -61380,7 +61382,7 @@ Example Git Diff is to follow:`
];
var INIT_MAIN_PROMPT = (language, prompts) => ({
role: "system",
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes ${config2.OCO_WHY ? "and WHY the changes were done" : ""}. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
${config2.OCO_EMOJI ? "Use GitMoji convention to preface the commit." : "Do not preface the commit with anything."}
${config2.OCO_DESCRIPTION ? `Add a short description of WHY the changes are done after the commit message. Don't start it with "This commit", just describe the changes.` : "Don't add any descriptions to the commit, only commit message."}
Use the present tense. Use ${language} to answer.
Expand All @@ -61400,34 +61402,39 @@ var commitlintPrompts = {
// src/modules/commitlint/pwd-commitlint.ts
var import_promises = __toESM(require("fs/promises"), 1);
var import_path3 = __toESM(require("path"), 1);
var findModulePath = (moduleName) => {
const searchPaths = [
import_path3.default.join("node_modules", moduleName),
import_path3.default.join("node_modules", ".pnpm")
];
for (const basePath of searchPaths) {
try {
const resolvedPath = require.resolve(moduleName, { paths: [basePath] });
return resolvedPath;
} catch {
}
}
throw new Error(`Cannot find module ${moduleName}`);
};
var getCommitLintModuleType = async () => {
const packageFile = "node_modules/@commitlint/load/package.json";
const packageJsonPath = import_path3.default.join(
process.env.PWD || process.cwd(),
packageFile
);
const packageFile = "@commitlint/load/package.json";
const packageJsonPath = findModulePath(packageFile);
const packageJson = JSON.parse(await import_promises.default.readFile(packageJsonPath, "utf8"));
if (!packageJson) {
throw new Error(`Failed to parse ${packageFile}`);
}
return packageJson.type === "module" ? "esm" : "cjs";
};
var getCommitLintPWDConfig = async () => {
let load, nodeModulesPath;
let load, modulePath;
switch (await getCommitLintModuleType()) {
case "cjs":
nodeModulesPath = import_path3.default.join(
process.env.PWD || process.cwd(),
"node_modules/@commitlint/load"
);
load = require(nodeModulesPath).default;
modulePath = findModulePath("@commitlint/load");
load = require(modulePath).default;
break;
case "esm":
nodeModulesPath = import_path3.default.join(
process.env.PWD || process.cwd(),
"node_modules/@commitlint/load/lib/load.js"
);
load = (await import(nodeModulesPath)).default;
modulePath = await findModulePath("@commitlint/load/lib/load.js");
load = (await import(modulePath)).default;
break;
}
if (load && typeof load === "function") {
Expand Down

0 comments on commit 23a8d76

Please sign in to comment.