@adamhl8/configs 3.0.1 → 3.0.3

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.
@@ -29,8 +29,8 @@ const bumpDeps = task(async ({ sh }) => {
29
29
  await sh`rm -rf node_modules/`;
30
30
  await sh`bun install --no-summary --no-cache`;
31
31
  });
32
- const test = task(async () => {
33
- await $`bun test --pass-with-no-tests`;
32
+ const test = task(async ({ sh }) => {
33
+ await sh`bun test --pass-with-no-tests`.echo(false);
34
34
  });
35
35
  const lint = task(async ({ sh }) => {
36
36
  await sh`bun markdown-toc -i --bullets - --maxdepth 3 ./README.md`;
@@ -63,8 +63,8 @@ const release = task(async ({ sh }) => {
63
63
  const releaseRun = task({ hidden: true }, async ({ sh }) => {
64
64
  await sh`bun release-it -VV --ci`;
65
65
  });
66
- const commitTypes = task(async () => {
67
- const { 2: types } = (await $`bun commitlint --print-config json`.quiet().json()).rules["type-enum"];
66
+ const commitTypes = task(async ({ sh }) => {
67
+ const { 2: types } = (await sh`bun commitlint --print-config json`.echo(false).json()).rules["type-enum"];
68
68
  console.log(`Commit types:\n ${types.join("\n ")}`);
69
69
  });
70
70
  list.after(async () => {
@@ -1 +1 @@
1
- {"version":3,"file":"bask.base.js","names":[],"sources":["../../src/configs/bask.base.ts"],"sourcesContent":["import { existsSync } from \"node:fs\"\n\nimport { list, task } from \"@adamhl8/bask\"\nimport bun, { $, Glob } from \"bun\"\n\n// oxlint-disable-next-line node/no-process-env\nconst inCi = Boolean(process.env[\"CI\"])\n\n/** Lists tracked and untracked files matching the pathspecs, skipping gitignored ones. */\nconst lsFiles = async (pathspecs: string[]) => {\n const output = await $`git ls-files -z --cached --others --exclude-standard -- ${pathspecs}`.quiet().text()\n return output.split(\"\\0\").filter(Boolean)\n}\n\n/** Checks that we're not in CI, the repo has a root tofu module, and the aws profile exists on this machine. */\nconst canRunTofu = async () => {\n if (inCi) return false\n const tofuFiles = await Array.fromAsync(new Glob(\"*.tofu\").scan())\n if (tofuFiles.length === 0) return false\n const profiles = await $`aws configure list-profiles`.nothrow().quiet().text()\n return profiles.split(\"\\n\").includes(\"adamhl8\")\n}\n\nexport const tofuCheck = task(async ({ sh }) => {\n if (await canRunTofu()) await sh`tofu plan -detailed-exitcode -concise -compact-warnings`\n})\n\nexport const prepare = task(async ({ sh }) => {\n // Skip `lefthook install` in CI so commits made by the workflows don't run the hooks.\n if (!inCi) await sh`lefthook install`\n await sh`bun adamhl8-gitignore`\n await sh`bun adamhl8-bunfig`\n await sh`bun oxfmt bunfig.toml`\n if (await canRunTofu()) await sh`tofu init -upgrade`\n})\n\nexport const bumpDeps = task(async ({ sh }) => {\n await sh`bunx npm-check-updates --upgrade --format group`\n await sh`rm -f bun.lock`\n await sh`rm -rf node_modules/`\n await sh`bun install --no-summary --no-cache`\n})\n\nexport const test = task(async () => {\n await $`bun test --pass-with-no-tests`\n})\n\nexport const lint = task(async ({ sh }) => {\n await sh`bun markdown-toc -i --bullets - --maxdepth 3 ./README.md`\n await sh`bun oxlint --fix --fix-suggestions --fix-dangerously`\n await sh`bun oxfmt`\n\n const tofuFiles = await lsFiles([\n \":(glob)**/*.tf\",\n \":(glob)**/*.tofu\",\n \":(glob)**/*.tfvars\",\n \":(glob)**/*.tftest.hcl\",\n \":(glob)**/*.tofutest.hcl\",\n ])\n if (tofuFiles.length > 0) await sh`tofu fmt ${tofuFiles}`\n\n await sh`bun knip-bun`\n if (existsSync(\".github/workflows\")) await sh`actionlint`\n await test()\n})\n\nexport const build = task(async ({ sh }) => {\n await lint()\n if (await bun.file(\"tsdown.config.ts\").exists()) await sh`bun tsdown`\n // Fail in CI if the build changed or created any files, because lint fixes and formatting are applied in place.\n // `--intent-to-add` makes untracked files show up in the diff.\n if (inCi) {\n await sh`git add --intent-to-add --all`\n await sh`git diff --exit-code`\n }\n await tofuCheck()\n})\n\nexport const release = task(async ({ sh }) => {\n await sh`gh workflow run release.yml`\n})\n\nexport const releaseRun = task({ hidden: true }, async ({ sh }) => {\n await sh`bun release-it -VV --ci`\n})\n\nexport const commitTypes = task(async () => {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n const config = (await $`bun commitlint --print-config json`.quiet().json()) as {\n rules: { \"type-enum\": [number, string, string[]] }\n }\n const { 2: types } = config.rules[\"type-enum\"]\n console.log(`Commit types:\\n ${types.join(\"\\n \")}`)\n})\n\nlist.after(async () => {\n console.log()\n await commitTypes()\n})\n"],"mappings":";;;;AAMA,MAAM,OAAO,QAAQ,QAAQ,IAAI,KAAK;;AAGtC,MAAM,UAAU,OAAO,cAAwB;CAE7C,QAAO,MADc,CAAC,2DAA2D,YAAY,MAAM,CAAC,CAAC,KAAK,EAAA,CAC5F,MAAM,IAAI,CAAC,CAAC,OAAO,OAAO;AAC1C;;AAGA,MAAM,aAAa,YAAY;CAC7B,IAAI,MAAM,OAAO;CAEjB,KAAI,MADoB,MAAM,UAAU,IAAI,KAAK,QAAQ,CAAC,CAAC,KAAK,CAAC,EAAA,CACnD,WAAW,GAAG,OAAO;CAEnC,QAAO,MADgB,CAAC,8BAA8B,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAA,CAC7D,MAAM,IAAI,CAAC,CAAC,SAAS,SAAS;AAChD;AAEA,MAAa,YAAY,KAAK,OAAO,EAAE,SAAS;CAC9C,IAAI,MAAM,WAAW,GAAG,MAAM,EAAE;AAClC,CAAC;AAED,MAAa,UAAU,KAAK,OAAO,EAAE,SAAS;CAE5C,IAAI,CAAC,MAAM,MAAM,EAAE;CACnB,MAAM,EAAE;CACR,MAAM,EAAE;CACR,MAAM,EAAE;CACR,IAAI,MAAM,WAAW,GAAG,MAAM,EAAE;AAClC,CAAC;AAED,MAAa,WAAW,KAAK,OAAO,EAAE,SAAS;CAC7C,MAAM,EAAE;CACR,MAAM,EAAE;CACR,MAAM,EAAE;CACR,MAAM,EAAE;AACV,CAAC;AAED,MAAa,OAAO,KAAK,YAAY;CACnC,MAAM,CAAC;AACT,CAAC;AAED,MAAa,OAAO,KAAK,OAAO,EAAE,SAAS;CACzC,MAAM,EAAE;CACR,MAAM,EAAE;CACR,MAAM,EAAE;CAER,MAAM,YAAY,MAAM,QAAQ;EAC9B;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,IAAI,UAAU,SAAS,GAAG,MAAM,EAAE,YAAY;CAE9C,MAAM,EAAE;CACR,IAAI,WAAW,mBAAmB,GAAG,MAAM,EAAE;CAC7C,MAAM,KAAK;AACb,CAAC;AAED,MAAa,QAAQ,KAAK,OAAO,EAAE,SAAS;CAC1C,MAAM,KAAK;CACX,IAAI,MAAM,IAAI,KAAK,kBAAkB,CAAC,CAAC,OAAO,GAAG,MAAM,EAAE;CAGzD,IAAI,MAAM;EACR,MAAM,EAAE;EACR,MAAM,EAAE;CACV;CACA,MAAM,UAAU;AAClB,CAAC;AAED,MAAa,UAAU,KAAK,OAAO,EAAE,SAAS;CAC5C,MAAM,EAAE;AACV,CAAC;AAED,MAAa,aAAa,KAAK,EAAE,QAAQ,KAAK,GAAG,OAAO,EAAE,SAAS;CACjE,MAAM,EAAE;AACV,CAAC;AAED,MAAa,cAAc,KAAK,YAAY;CAK1C,MAAM,EAAE,GAAG,WAAU,MAHC,CAAC,qCAAqC,MAAM,CAAC,CAAC,KAAK,EAAA,CAG7C,MAAM;CAClC,QAAQ,IAAI,sBAAsB,MAAM,KAAK,QAAQ,GAAG;AAC1D,CAAC;AAED,KAAK,MAAM,YAAY;CACrB,QAAQ,IAAI;CACZ,MAAM,YAAY;AACpB,CAAC"}
1
+ {"version":3,"file":"bask.base.js","names":[],"sources":["../../src/configs/bask.base.ts"],"sourcesContent":["import { existsSync } from \"node:fs\"\n\nimport { list, task } from \"@adamhl8/bask\"\nimport bun, { $, Glob } from \"bun\"\n\n// oxlint-disable-next-line node/no-process-env\nconst inCi = Boolean(process.env[\"CI\"])\n\n/** Lists tracked and untracked files matching the pathspecs, skipping gitignored ones. */\nconst lsFiles = async (pathspecs: string[]) => {\n const output = await $`git ls-files -z --cached --others --exclude-standard -- ${pathspecs}`.quiet().text()\n return output.split(\"\\0\").filter(Boolean)\n}\n\n/** Checks that we're not in CI, the repo has a root tofu module, and the aws profile exists on this machine. */\nconst canRunTofu = async () => {\n if (inCi) return false\n const tofuFiles = await Array.fromAsync(new Glob(\"*.tofu\").scan())\n if (tofuFiles.length === 0) return false\n const profiles = await $`aws configure list-profiles`.nothrow().quiet().text()\n return profiles.split(\"\\n\").includes(\"adamhl8\")\n}\n\nexport const tofuCheck = task(async ({ sh }) => {\n if (await canRunTofu()) await sh`tofu plan -detailed-exitcode -concise -compact-warnings`\n})\n\nexport const prepare = task(async ({ sh }) => {\n // Skip `lefthook install` in CI so commits made by the workflows don't run the hooks.\n if (!inCi) await sh`lefthook install`\n await sh`bun adamhl8-gitignore`\n await sh`bun adamhl8-bunfig`\n await sh`bun oxfmt bunfig.toml`\n if (await canRunTofu()) await sh`tofu init -upgrade`\n})\n\nexport const bumpDeps = task(async ({ sh }) => {\n await sh`bunx npm-check-updates --upgrade --format group`\n await sh`rm -f bun.lock`\n await sh`rm -rf node_modules/`\n await sh`bun install --no-summary --no-cache`\n})\n\nexport const test = task(async ({ sh }) => {\n await sh`bun test --pass-with-no-tests`.echo(false)\n})\n\nexport const lint = task(async ({ sh }) => {\n await sh`bun markdown-toc -i --bullets - --maxdepth 3 ./README.md`\n await sh`bun oxlint --fix --fix-suggestions --fix-dangerously`\n await sh`bun oxfmt`\n\n const tofuFiles = await lsFiles([\n \":(glob)**/*.tf\",\n \":(glob)**/*.tofu\",\n \":(glob)**/*.tfvars\",\n \":(glob)**/*.tftest.hcl\",\n \":(glob)**/*.tofutest.hcl\",\n ])\n if (tofuFiles.length > 0) await sh`tofu fmt ${tofuFiles}`\n\n await sh`bun knip-bun`\n if (existsSync(\".github/workflows\")) await sh`actionlint`\n await test()\n})\n\nexport const build = task(async ({ sh }) => {\n await lint()\n if (await bun.file(\"tsdown.config.ts\").exists()) await sh`bun tsdown`\n // Fail in CI if the build changed or created any files, because lint fixes and formatting are applied in place.\n // `--intent-to-add` makes untracked files show up in the diff.\n if (inCi) {\n await sh`git add --intent-to-add --all`\n await sh`git diff --exit-code`\n }\n await tofuCheck()\n})\n\nexport const release = task(async ({ sh }) => {\n await sh`gh workflow run release.yml`\n})\n\nexport const releaseRun = task({ hidden: true }, async ({ sh }) => {\n await sh`bun release-it -VV --ci`\n})\n\nexport const commitTypes = task(async ({ sh }) => {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n const config = (await sh`bun commitlint --print-config json`.echo(false).json()) as {\n rules: { \"type-enum\": [number, string, string[]] }\n }\n const { 2: types } = config.rules[\"type-enum\"]\n console.log(`Commit types:\\n ${types.join(\"\\n \")}`)\n})\n\nlist.after(async () => {\n console.log()\n await commitTypes()\n})\n"],"mappings":";;;;AAMA,MAAM,OAAO,QAAQ,QAAQ,IAAI,KAAK;;AAGtC,MAAM,UAAU,OAAO,cAAwB;CAE7C,QAAO,MADc,CAAC,2DAA2D,YAAY,MAAM,CAAC,CAAC,KAAK,EAAA,CAC5F,MAAM,IAAI,CAAC,CAAC,OAAO,OAAO;AAC1C;;AAGA,MAAM,aAAa,YAAY;CAC7B,IAAI,MAAM,OAAO;CAEjB,KAAI,MADoB,MAAM,UAAU,IAAI,KAAK,QAAQ,CAAC,CAAC,KAAK,CAAC,EAAA,CACnD,WAAW,GAAG,OAAO;CAEnC,QAAO,MADgB,CAAC,8BAA8B,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAA,CAC7D,MAAM,IAAI,CAAC,CAAC,SAAS,SAAS;AAChD;AAEA,MAAa,YAAY,KAAK,OAAO,EAAE,SAAS;CAC9C,IAAI,MAAM,WAAW,GAAG,MAAM,EAAE;AAClC,CAAC;AAED,MAAa,UAAU,KAAK,OAAO,EAAE,SAAS;CAE5C,IAAI,CAAC,MAAM,MAAM,EAAE;CACnB,MAAM,EAAE;CACR,MAAM,EAAE;CACR,MAAM,EAAE;CACR,IAAI,MAAM,W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@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamhl8/configs",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "My shared configs for TS projects",
5
5
  "homepage": "https://github.com/adamhl8/configs",
6
6
  "bugs": {
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@adamhl8/eslint-plugin-clean-modules": "^0.1.5",
53
- "@commitlint/config-conventional": "^21.2.3",
53
+ "@commitlint/config-conventional": "^21.2.4",
54
54
  "@commitlint/types": "^21.2.3",
55
55
  "arkenv": "^0.12.3",
56
56
  "arktype": "^2.2.8",
@@ -59,12 +59,12 @@
59
59
  "type-fest": "^5.10.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@adamhl8/bask": "^0.1.0",
62
+ "@adamhl8/bask": "^0.3.0",
63
63
  "@adamhl8/configs": "file:.",
64
64
  "@arethetypeswrong/core": "^0.18.5",
65
- "@commitlint/cli": "^21.2.3",
65
+ "@commitlint/cli": "^21.2.4",
66
66
  "@types/bun": "^1.4.3",
67
- "knip": "^6.41.0",
67
+ "knip": "^6.42.0",
68
68
  "markdown-toc": "^1.2.0",
69
69
  "oxfmt": "^0.73.0",
70
70
  "oxlint": "^1.88.0",