@theholocron/cli 3.28.1 → 3.29.1
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/dist/cli.mjs +43 -0
- package/dist/cli.mjs.map +1 -1
- package/package.json +4 -4
package/dist/cli.mjs
CHANGED
|
@@ -3019,6 +3019,41 @@ const ALEX_CONFIG = JSON.stringify({ allow: [
|
|
|
3019
3019
|
"husky",
|
|
3020
3020
|
"period"
|
|
3021
3021
|
] }, null, 2) + "\n";
|
|
3022
|
+
function devmojiConfigContent() {
|
|
3023
|
+
return [
|
|
3024
|
+
`/* eslint-disable */`,
|
|
3025
|
+
`// devmoji.config.cjs — generated by holocron setup, do not edit`,
|
|
3026
|
+
`// https://github.com/folke/devmoji`,
|
|
3027
|
+
`const { defineConfig } = require("@theholocron/devmoji-config");`,
|
|
3028
|
+
`module.exports = defineConfig();`,
|
|
3029
|
+
``
|
|
3030
|
+
].join("\n");
|
|
3031
|
+
}
|
|
3032
|
+
function prepareCommitMsgHookContent() {
|
|
3033
|
+
return [
|
|
3034
|
+
`#!/bin/sh`,
|
|
3035
|
+
``,
|
|
3036
|
+
`NAME=$(git config user.name)`,
|
|
3037
|
+
`EMAIL=$(git config user.email)`,
|
|
3038
|
+
``,
|
|
3039
|
+
`if [ -z "$NAME" ]; then`,
|
|
3040
|
+
`\techo "empty git config user.name"`,
|
|
3041
|
+
`\texit 1`,
|
|
3042
|
+
`fi`,
|
|
3043
|
+
``,
|
|
3044
|
+
`if [ -z "$EMAIL" ]; then`,
|
|
3045
|
+
`\techo "empty git config user.email"`,
|
|
3046
|
+
`\texit 1`,
|
|
3047
|
+
`fi`,
|
|
3048
|
+
``,
|
|
3049
|
+
`git interpret-trailers --if-exists doNothing --trailer \\`,
|
|
3050
|
+
`\t"Signed-off-by: $NAME <$EMAIL>" \\`,
|
|
3051
|
+
`\t--in-place "$1"`,
|
|
3052
|
+
``,
|
|
3053
|
+
`npx devmoji -e`,
|
|
3054
|
+
``
|
|
3055
|
+
].join("\n");
|
|
3056
|
+
}
|
|
3022
3057
|
const CANONICAL_LABELS = [
|
|
3023
3058
|
{
|
|
3024
3059
|
name: "bug",
|
|
@@ -3383,6 +3418,14 @@ async function runSetup(input) {
|
|
|
3383
3418
|
await source.writeRepoFile(".editorconfig-checker.json", EDITORCONFIG_CHECKER_CONFIG);
|
|
3384
3419
|
}));
|
|
3385
3420
|
print(formatStep(steps[steps.length - 1]));
|
|
3421
|
+
steps.push(await runStep("source", "write devmoji.config.cjs", dryRun, async () => {
|
|
3422
|
+
await source.writeRepoFile("devmoji.config.cjs", devmojiConfigContent());
|
|
3423
|
+
}));
|
|
3424
|
+
print(formatStep(steps[steps.length - 1]));
|
|
3425
|
+
steps.push(await runStep("source", "write .husky/prepare-commit-msg", dryRun, async () => {
|
|
3426
|
+
await source.writeRepoFile(".husky/prepare-commit-msg", prepareCommitMsgHookContent());
|
|
3427
|
+
}));
|
|
3428
|
+
print(formatStep(steps[steps.length - 1]));
|
|
3386
3429
|
{
|
|
3387
3430
|
const hasTestWorkflow = (config.workflows ?? []).map((e) => typeof e === "string" ? e : e.name).includes("test");
|
|
3388
3431
|
const packages = await readWorkspacePackages(input.context.repoRoot);
|