@shopify/create-app
Version:
A CLI tool to create a new Shopify app.
50 lines (48 loc) • 2.29 kB
JavaScript
import {
execaSync,
fileExistsSync,
isDevelopment
} from "./chunk-YZFEE3WJ.js";
import {
require_lib
} from "./chunk-V7OWCSFT.js";
import "./chunk-UMUTXITN.js";
import {
cwd,
joinPath,
sniffForPath
} from "./chunk-Y2JP6WFP.js";
import "./chunk-6ONJEX7Y.js";
import "./chunk-LABBARNJ.js";
import "./chunk-CTFDRWUN.js";
import "./chunk-7IK72W75.js";
import "./chunk-G2ZZKGSV.js";
import {
__toESM,
init_cjs_shims
} from "./chunk-PKR7KJ6P.js";
// ../cli-kit/dist/public/node/custom-oclif-loader.js
init_cjs_shims();
var import_core = __toESM(require_lib(), 1), ShopifyConfig = class extends import_core.Config {
constructor(options) {
if (isDevelopment()) {
let currentPath = cwd(), path = sniffForPath() ?? currentPath, currentPathMightBeHydrogenMonorepo = /(shopify|hydrogen)\/hydrogen/i.test(currentPath), ignoreHydrogenMonorepo = process.env.IGNORE_HYDROGEN_MONOREPO;
currentPathMightBeHydrogenMonorepo && !ignoreHydrogenMonorepo && (path = execaSync("npm", ["prefix"]).stdout.trim()), fileExistsSync(joinPath(path, "package.json")) && (options.pluginAdditions = {
core: ["@shopify/cli-hydrogen"],
path
});
}
super(options), isDevelopment() && (this.determinePriority = this.customPriority);
}
customPriority(commands) {
let oclifPlugins = this.pjson.oclif.plugins ?? [];
return commands.sort((aCommand, bCommand) => {
let pluginAliasA = aCommand.pluginAlias ?? "A-Cannot-Find-This", pluginAliasB = bCommand.pluginAlias ?? "B-Cannot-Find-This", aIndex = oclifPlugins.indexOf(pluginAliasA), bIndex = oclifPlugins.indexOf(pluginAliasB);
return aCommand.pluginType === "core" && bCommand.pluginAlias === "@shopify/cli-hydrogen" ? 1 : aCommand.pluginAlias === "@shopify/cli-hydrogen" && bCommand.pluginType === "core" ? -1 : aCommand.pluginType === "core" && bCommand.pluginType === "core" ? aIndex - bIndex : bCommand.pluginType === "core" && aCommand.pluginType !== "core" ? 1 : aCommand.pluginType === "core" && bCommand.pluginType !== "core" ? -1 : aCommand.pluginType === "jit" && bCommand.pluginType !== "jit" ? 1 : bCommand.pluginType === "jit" && aCommand.pluginType !== "jit" ? -1 : 0;
})[0];
}
};
export {
ShopifyConfig
};
//# sourceMappingURL=custom-oclif-loader-LMLLWIIT.js.map