{"version":3,"file":"get-config-BHi_Guex.mjs","names":["releaseRules","releaseRulesDefault"],"sources":["../src/plugins/commit-analyzer.ts","../src/plugins/git.ts","../src/plugins/github.ts","../src/plugins/npm.ts","../src/plugins/plugin-options.ts","../src/get-config.ts"],"sourcesContent":["import { releaseRules as releaseRulesDefault } from \"@jeromefitz/conventional-gitmoji\";\nimport type { PluginSpec } from \"semantic-release\";\n\nimport type { ReleaseRule } from \"./commit-analyzer.types\";\n\nconst commitAnalyzer = (releaseRulesPassed: ReleaseRule[] = []): PluginSpec => {\n  const releaseRules = [...releaseRulesDefault, ...releaseRulesPassed];\n\n  return [\n    \"@semantic-release/commit-analyzer\",\n    {\n      config: \"@jeromefitz/conventional-gitmoji\",\n      releaseRules,\n    },\n  ];\n};\n\nexport { commitAnalyzer };\n","import type { PluginSpec } from \"semantic-release\";\n\nimport type { GitPluginOptions } from \"./git.types\";\n\n/**\n * @note\n *\n * This will modify `package.json` use with caution\n * Most times you will skip this package and only use NPM publishing\n *\n */\nconst git = (options: GitPluginOptions): PluginSpec => {\n  return [\n    \"@semantic-release/git\",\n    {\n      assets: options.gitAssets === false ? false : [\"package.json\", ...(options.gitAssets ?? [])],\n      message:\n        options.message ??\n        /**\n         * @note(semantic-release) template processed at runtime\n         */\n        // oxlint-disable-next-line no-template-curly-in-string\n        \"🔖️ `${nextRelease.gitTag}` [skip ci] \\n\\n${nextRelease.notes}\",\n    },\n  ];\n};\n\nexport { git };\n","import type { PluginSpec } from \"semantic-release\";\n\nimport type { GithubPluginOptions } from \"./github.types\";\n\nconst github = (options: GithubPluginOptions = {}): PluginSpec => {\n  const { githubAssets, ...config } = options;\n  return [\n    \"@semantic-release/github\",\n    {\n      addReleases: false,\n      assets: githubAssets,\n      labels: false,\n      releasedLabels: false,\n      successComment: false,\n      ...config,\n    },\n  ];\n};\n\nexport { github };\n","import type { PluginSpec } from \"semantic-release\";\n\nimport type { NPMPluginOptions } from \"./npm.types\";\n\nconst npm = (options?: NPMPluginOptions): PluginSpec => {\n  if (\n    !options ||\n    (typeof options.pkgRoot !== \"string\" &&\n      typeof options.npmPublish !== \"boolean\" &&\n      typeof options.tarballDir === \"undefined\")\n  )\n    return \"@semantic-release/npm\";\n\n  return [\n    \"@semantic-release/npm\",\n    {\n      // npmPublish: true,\n      // tarballDir: 'release',\n      // @note this may be oddly expensive\n      // @ref https://prateeksurana.me/blog/why-using-object-spread-with-reduce-bad-idea/\n      ...options,\n    },\n  ];\n};\n\nexport { npm };\n","import { parserOpts, writerOpts } from \"@jeromefitz/conventional-gitmoji\";\nimport type { PluginSpec } from \"semantic-release\";\n\nimport { commitAnalyzer, git, github, npm } from \"./index\";\nimport type { PluginOptions } from \"./plugin-options.types\";\n\nconst getPluginOptions = (optionsPassed?: PluginOptions): PluginSpec[] => {\n  const options: PluginOptions = {\n    enableGit: false,\n    enableGithub: true,\n    enableNpm: true,\n    enableReleaseNotes: false,\n    enableReleaseNotesCustom: true,\n    pkgRoot: \"./dist\",\n    ...optionsPassed,\n  };\n\n  const releaseNotesConfig: PluginSpec = [\n    \"@semantic-release/release-notes-generator\",\n    {\n      config: \"@jeromefitz/conventional-gitmoji\",\n      parserOpts,\n      writerOpts,\n    },\n  ];\n  const releaseNotesCustomConfig: PluginSpec = \"@jeromefitz/release-notes-generator\";\n\n  const { npmPublish, pkgRoot, tarballDir } = options;\n  const npmConfig = npm({ npmPublish, pkgRoot, tarballDir });\n\n  const {\n    addReleases,\n    assignees,\n    failComment,\n    failTitle,\n    githubApiPathPrefix,\n    githubAssets,\n    githubUrl,\n    labels,\n    proxy,\n    releasedLabels,\n  } = options;\n  const githubConfig = github({\n    addReleases,\n    assignees,\n    failComment,\n    failTitle,\n    githubApiPathPrefix,\n    githubAssets,\n    githubUrl,\n    labels,\n    proxy,\n    releasedLabels,\n  });\n\n  const gitConfig = git(options);\n\n  return [\n    commitAnalyzer(options.releaseRules),\n    ...(options.enableReleaseNotes ? [releaseNotesConfig] : []),\n    ...(options.enableReleaseNotesCustom ? [releaseNotesCustomConfig] : []),\n    ...(options.enableNpm ? [npmConfig] : []),\n    ...(options.enableGithub ? [githubConfig] : []),\n    ...(options.enableGit ? [gitConfig] : []),\n  ];\n};\n\nexport { getPluginOptions };\n","import type { Options as SemanticReleaseOptions } from \"semantic-release\";\n\nimport type { PluginOptions } from \"./plugins/index\";\nimport { getPluginOptions } from \"./plugins/index\";\n\ntype GetConfigOptions = Partial<Omit<SemanticReleaseOptions, \"plugins\">> & PluginOptions;\n\nconst getConfig = (configPassed: GetConfigOptions = {}): SemanticReleaseOptions => {\n  const plugins = getPluginOptions(configPassed);\n\n  return {\n    branches: [{ name: \"main\" }, { name: \"canary\", prerelease: \"canary\" }],\n    extends: [\"semantic-release-commit-filter\"],\n    tagFormat: `v\\${version}`,\n    ...(configPassed as Partial<SemanticReleaseOptions>),\n    plugins,\n  };\n};\n\nexport type { GetConfigOptions };\nexport { getConfig };\n"],"mappings":"gGAKA,MAAM,GAAkB,EAAoC,CAAC,IAGpD,CACL,oCACA,CACE,OAAQ,mCACR,aAAA,CANkB,GAAGC,EAAqB,GAAG,CAM7C,CACF,CACF,ECHI,EAAO,GACJ,CACL,wBACA,CACE,OAAQ,EAAQ,YAAc,GAAQ,GAAQ,CAAC,eAAgB,GAAI,EAAQ,WAAa,CAAC,CAAE,EAC3F,QACE,EAAQ,SAKR,gEACJ,CACF,ECpBI,GAAU,EAA+B,CAAC,IAAkB,CAChE,GAAM,CAAE,eAAc,GAAG,GAAW,EACpC,MAAO,CACL,2BACA,CACE,YAAa,GACb,OAAQ,EACR,OAAQ,GACR,eAAgB,GAChB,eAAgB,GAChB,GAAG,CACL,CACF,CACF,ECbM,EAAO,GAET,CAAC,GACA,OAAO,EAAQ,SAAY,UAC1B,OAAO,EAAQ,YAAe,WACvB,EAAQ,aAAe,OAEzB,wBAEF,CACL,wBACA,CAKE,GAAG,CACL,CACF,EChBI,EAAoB,GAAgD,CACxE,IAAM,EAAyB,CAC7B,UAAW,GACX,aAAc,GACd,UAA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