From 8e4be527c237eef8f98d3010d5e63a9c52121578 Mon Sep 17 00:00:00 2001 From: stephansama Date: Sat, 16 May 2026 14:42:43 -0400 Subject: [PATCH 1/8] feat(core): update dependencies for mdast-zone and remark-usage --- core/auto-readme/package.json | 4 +- core/auto-readme/src/pipeline.test.ts | 12 ++-- core/auto-readme/src/pipeline.ts | 2 +- core/auto-readme/src/plugin.ts | 2 +- pnpm-lock.yaml | 86 +++++++++++++-------------- pnpm-workspace.yaml | 4 +- 6 files changed, 55 insertions(+), 55 deletions(-) diff --git a/core/auto-readme/package.json b/core/auto-readme/package.json index cbc9b288..9d9a10bb 100644 --- a/core/auto-readme/package.json +++ b/core/auto-readme/package.json @@ -55,6 +55,8 @@ "dependencies": { "@manypkg/find-root": "catalog:manypkg", "@manypkg/get-packages": "catalog:manypkg", + "@stephansama/mdast-zone": "catalog:", + "@stephansama/remark-usage": "catalog:remark", "colord": "catalog:", "cosmiconfig": "catalog:cli", "deepmerge": "catalog:", @@ -64,7 +66,6 @@ "mdast": "catalog:", "mdast-comment-marker": "catalog:", "mdast-util-from-markdown": "catalog:", - "mdast-zone": "catalog:", "obug": "catalog:cli", "picospinner": "catalog:cli", "pkg-types": "catalog:", @@ -72,7 +73,6 @@ "remark-code-import": "catalog:remark", "remark-collapse": "catalog:remark", "remark-toc": "catalog:remark", - "remark-usage": "catalog:remark", "simple-icons": "catalog:", "smol-toml": "catalog:", "tinyglobby": "catalog:", diff --git a/core/auto-readme/src/pipeline.test.ts b/core/auto-readme/src/pipeline.test.ts index 7edd2088..083403d6 100644 --- a/core/auto-readme/src/pipeline.test.ts +++ b/core/auto-readme/src/pipeline.test.ts @@ -1,7 +1,7 @@ +import remarkUsage from "@stephansama/remark-usage"; import remarkCodeImport from "remark-code-import"; import remarkCollapse from "remark-collapse"; import remarkToc from "remark-toc"; -import remarkUsage from "remark-usage"; import { afterEach, beforeEach, expect, it, vi } from "vitest"; import type { ActionData } from "./data"; @@ -27,16 +27,16 @@ const mocks = vi.hoisted(() => { }; }); +vi.mock("./data", () => ({ createFindParameter: mocks.createFindParameter })); +vi.mock("./log", () => ({ INFO: vi.fn(), WARN: mocks.warn })); +vi.mock("./plugin", () => ({ autoReadmeRemarkPlugin: vi.fn() })); +vi.mock("./utilities", () => ({ fileExists: mocks.fileExists })); +vi.mock("@stephansama/remark-usage", () => ({ default: vi.fn() })); vi.mock("remark", () => ({ remark: mocks.remark })); vi.mock("remark-code-import", () => ({ default: vi.fn() })); vi.mock("remark-collapse", () => ({ default: vi.fn() })); vi.mock("remark-toc", () => ({ default: vi.fn() })); -vi.mock("remark-usage", () => ({ default: vi.fn() })); vi.mock("vfile", () => ({ VFile: vi.fn() })); -vi.mock("./plugin", () => ({ autoReadmeRemarkPlugin: vi.fn() })); -vi.mock("./data", () => ({ createFindParameter: mocks.createFindParameter })); -vi.mock("./utilities", () => ({ fileExists: mocks.fileExists })); -vi.mock("./log", () => ({ INFO: vi.fn(), WARN: mocks.warn })); afterEach(vi.clearAllMocks); diff --git a/core/auto-readme/src/pipeline.ts b/core/auto-readme/src/pipeline.ts index 85e8956f..68d8ccc0 100644 --- a/core/auto-readme/src/pipeline.ts +++ b/core/auto-readme/src/pipeline.ts @@ -1,9 +1,9 @@ +import remarkUsage from "@stephansama/remark-usage"; import path from "node:path"; import { remark } from "remark"; import remarkCodeImport from "remark-code-import"; import remarkCollapse from "remark-collapse"; import remarkToc from "remark-toc"; -import remarkUsage from "remark-usage"; import { VFile } from "vfile"; import type { ActionData } from "./data"; diff --git a/core/auto-readme/src/plugin.ts b/core/auto-readme/src/plugin.ts index 2e6fb52a..00363e95 100644 --- a/core/auto-readme/src/plugin.ts +++ b/core/auto-readme/src/plugin.ts @@ -1,10 +1,10 @@ import type { Root } from "mdast"; import type { Plugin } from "unified"; +import { zone } from "@stephansama/mdast-zone"; import Handlebars from "handlebars"; import { markdownTable } from "markdown-table"; import { fromMarkdown } from "mdast-util-from-markdown"; -import { zone } from "mdast-zone"; import path from "node:path"; import type { ActionData } from "./data"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 14ba433a..17a026d9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -78,6 +78,9 @@ catalogs: '@kba/makefile-parser': specifier: 0.0.6 version: 0.0.6 + '@stephansama/mdast-zone': + specifier: 6.1.0 + version: 6.1.0 '@tailwindcss/cli': specifier: 4.2.1 version: 4.2.1 @@ -174,9 +177,6 @@ catalogs: mdast-util-from-markdown: specifier: 2.0.2 version: 2.0.2 - mdast-zone: - specifier: github:stephansama/mdast-zone#1c5b08cd97240debeed4c9c6afad49df5877a132 - version: 6.1.0 minify: specifier: 14.0.0 version: 14.0.0 @@ -433,6 +433,9 @@ catalogs: specifier: 0.7.2 version: 0.7.2 remark: + '@stephansama/remark-usage': + specifier: 11.0.1 + version: 11.0.1 remark: specifier: 15.0.1 version: 15.0.1 @@ -445,9 +448,6 @@ catalogs: remark-toc: specifier: 9.0.0 version: 9.0.0 - remark-usage: - specifier: 11.0.1 - version: 11.0.1 schema: '@standard-schema/spec': specifier: 1.1.0 @@ -812,6 +812,12 @@ importers: '@manypkg/get-packages': specifier: catalog:manypkg version: 3.1.0 + '@stephansama/mdast-zone': + specifier: 'catalog:' + version: 6.1.0 + '@stephansama/remark-usage': + specifier: catalog:remark + version: 11.0.1 colord: specifier: 'catalog:' version: 2.9.3 @@ -839,9 +845,6 @@ importers: mdast-util-from-markdown: specifier: 'catalog:' version: 2.0.2 - mdast-zone: - specifier: 'catalog:' - version: https://codeload.github.com/stephansama/mdast-zone/tar.gz/1c5b08cd97240debeed4c9c6afad49df5877a132 obug: specifier: catalog:cli version: 2.1.1 @@ -863,9 +866,6 @@ importers: remark-toc: specifier: catalog:remark version: 9.0.0 - remark-usage: - specifier: catalog:remark - version: 11.0.1 simple-icons: specifier: 'catalog:' version: 16.19.0 @@ -4339,6 +4339,12 @@ packages: '@standard-schema/spec@1.1.0': resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + '@stephansama/mdast-zone@6.1.0': + resolution: {integrity: sha512-BnAn17mIZedlyCcNebKEStMQ0YZ6cuS6DXSVnLquMhAfQnv7lrwjPn0D0682wSQYz6PZp4XBO5svVoMg32FGsg==} + + '@stephansama/remark-usage@11.0.1': + resolution: {integrity: sha512-rjZprojcBYSYWDeiY1m4FLvZZ9/xkuqnmQOqZFm+FdUC9RKFehJN2cwml1GXcG7ngj8FaeOgXlCXuNfkJ+ahQQ==} + '@storybook/addon-a11y@10.2.8': resolution: {integrity: sha512-EW5MzPKNzyPorvodd416U2Np+zEdMPe+BSyomjm0oCXoC/6rDurf05H1pa99rZsrTDRrpog+HCz8iVa4XSwN5Q==} peerDependencies: @@ -8919,10 +8925,6 @@ packages: mdast-util-toc@7.1.0: resolution: {integrity: sha512-2TVKotOQzqdY7THOdn2gGzS9d1Sdd66bvxUyw3aNpWfcPXCLYSJCCgfPy30sEtuzkDraJgqF35dzgmz6xlvH/w==} - mdast-zone@https://codeload.github.com/stephansama/mdast-zone/tar.gz/1c5b08cd97240debeed4c9c6afad49df5877a132: - resolution: {gitHosted: true, tarball: https://codeload.github.com/stephansama/mdast-zone/tar.gz/1c5b08cd97240debeed4c9c6afad49df5877a132} - version: 6.1.0 - mdast@3.0.0: resolution: {integrity: sha512-xySmf8g4fPKMeC07jXGz971EkLbWAJ83s4US2Tj9lEdnZ142UP5grN73H1Xd3HzrdbU5o9GYYP/y8F9ZSwLE9g==} deprecated: '`mdast` was renamed to `remark`' @@ -10267,9 +10269,6 @@ packages: remark-toc@9.0.0: resolution: {integrity: sha512-KJ9txbo33GjDAV1baHFze7ij4G8c7SGYoY8Kzsm2gzFpbhL/bSoVpMMzGa3vrNDSWASNd/3ppAqL7cP2zD6JIA==} - remark-usage@11.0.1: - resolution: {integrity: sha512-zzZlVmmLM6vCAw0XEihJlKNi2YRGr52XKatyZ9R5QjN6PAsmCbJlgIjrGj55OwFWE+tAwVoolhrp0oO136xEcw==} - remark@15.0.1: resolution: {integrity: sha512-Eht5w30ruCXgFmxVUSlNWQ9iiimq07URKeFS3hNc8cUWy1llX4KDWfyEDZRycMc+znsN9Ux5/tJ/BFdgdOwA3A==} @@ -14886,6 +14885,31 @@ snapshots: '@standard-schema/spec@1.1.0': {} + '@stephansama/mdast-zone@6.1.0': + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + mdast-comment-marker: 3.0.0 + unist-util-visit: 5.1.0 + transitivePeerDependencies: + - supports-color + + '@stephansama/remark-usage@11.0.1': + dependencies: + '@babel/core': 7.28.0 + '@babel/preset-typescript': 7.28.5(@babel/core@7.28.0) + '@types/mdast': 4.0.4 + import-meta-resolve: 4.2.0 + mdast-util-from-markdown: 2.0.3 + mdast-util-heading-range: 4.0.0 + nanoid: 4.0.2 + unist-util-remove-position: 5.0.0 + vfile: 6.0.3 + vfile-find-up: 7.1.0 + vfile-message: 4.0.2 + transitivePeerDependencies: + - supports-color + '@storybook/addon-a11y@10.2.8(storybook@10.2.8(@testing-library/dom@10.4.1)(prettier@3.8.1)(react-dom@19.2.0(react@19.2.1))(react@19.2.1))': dependencies: '@storybook/global': 5.0.0 @@ -20371,15 +20395,6 @@ snapshots: unist-util-is: 6.0.1 unist-util-visit: 5.1.0 - mdast-zone@https://codeload.github.com/stephansama/mdast-zone/tar.gz/1c5b08cd97240debeed4c9c6afad49df5877a132: - dependencies: - '@types/mdast': 4.0.4 - '@types/unist': 3.0.3 - mdast-comment-marker: 3.0.0 - unist-util-visit: 5.1.0 - transitivePeerDependencies: - - supports-color - mdast@3.0.0: {} mdn-data@2.0.28: {} @@ -22080,21 +22095,6 @@ snapshots: '@types/mdast': 4.0.4 mdast-util-toc: 7.1.0 - remark-usage@11.0.1: - dependencies: - '@babel/core': 7.28.0 - '@types/mdast': 4.0.4 - import-meta-resolve: 4.2.0 - mdast-util-from-markdown: 2.0.3 - mdast-util-heading-range: 4.0.0 - nanoid: 4.0.2 - unist-util-remove-position: 5.0.0 - vfile: 6.0.3 - vfile-find-up: 7.1.0 - vfile-message: 4.0.2 - transitivePeerDependencies: - - supports-color - remark@15.0.1: dependencies: '@types/mdast': 4.0.4 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 5ba24629..1676e541 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -57,7 +57,7 @@ catalog: mdast: 3.0.0 mdast-comment-marker: 3.0.0 mdast-util-from-markdown: 2.0.2 - mdast-zone: github:stephansama/mdast-zone#1c5b08cd97240debeed4c9c6afad49df5877a132 + '@stephansama/mdast-zone': 6.1.0 minify: 14.0.0 monoman: 0.8.2 nano-staged: 1.0.2 @@ -167,11 +167,11 @@ catalogs: prettier-plugin-svelte: 3.4.1 prettier-plugin-tailwindcss: 0.7.2 remark: + '@stephansama/remark-usage': 11.0.1 remark: 15.0.1 remark-code-import: 1.2.0 remark-collapse: 0.1.2 remark-toc: 9.0.0 - remark-usage: 11.0.1 schema: '@standard-schema/spec': 1.1.0 arktype: 2.2.0 From 6d2293a8db3cfb796fd550072ebeb95e9fe379ad Mon Sep 17 00:00:00 2001 From: stephansama Date: Sat, 16 May 2026 15:06:29 -0400 Subject: [PATCH 2/8] feat(core): update usage files to typescript --- .config/autoreadmerc.json | 2 +- core/eslint-config/README.md | 2 +- .../example/{index.js => index.ts} | 0 core/eslint-config/tsconfig.json | 2 +- core/pnpm-hooks/README.md | 7 +- core/pnpm-hooks/example/index.js | 6 -- core/pnpm-hooks/example/index.ts | 5 ++ core/pnpm-hooks/tsconfig.json | 2 +- core/prettier-plugin-handlebars/README.md | 7 +- .../example/{index.js => index.ts} | 5 +- core/prettier-plugin-handlebars/tsconfig.json | 2 +- core/remark-asciinema/README.md | 4 +- .../example/{index.js => index.ts} | 2 +- core/remark-asciinema/tsconfig.json | 2 +- core/single-file/README.md | 2 +- .../example/{index.js => index.ts} | 0 core/single-file/tsconfig.json | 2 +- core/typed-env/README.md | 4 +- core/typed-env/example/{index.js => index.ts} | 3 - core/typed-env/tsconfig.json | 2 +- core/typed-events/README.md | 87 ++++++++++++------- .../example/{index.js => index.ts} | 42 ++++++--- core/typed-events/tsconfig.json | 2 +- core/typed-nocodb-api/README.md | 6 +- .../example/{index.js => index.ts} | 6 +- core/typed-nocodb-api/tsconfig.json | 2 +- core/typed-templates/README.md | 6 +- .../example/{index.js => index.ts} | 2 - core/typed-templates/tsconfig.json | 9 +- core/types-lhci/README.md | 9 +- .../__snapshots__/tsnapi/index.snapshot.d.ts | 48 +++++----- .../types-lhci/example/{index.js => index.ts} | 5 +- core/types-lhci/src/index.ts | 52 ++++++----- core/types-lhci/tsconfig.json | 4 +- 34 files changed, 193 insertions(+), 148 deletions(-) rename core/eslint-config/example/{index.js => index.ts} (100%) delete mode 100644 core/pnpm-hooks/example/index.js create mode 100644 core/pnpm-hooks/example/index.ts rename core/prettier-plugin-handlebars/example/{index.js => index.ts} (65%) rename core/remark-asciinema/example/{index.js => index.ts} (84%) rename core/single-file/example/{index.js => index.ts} (100%) rename core/typed-env/example/{index.js => index.ts} (78%) rename core/typed-events/example/{index.js => index.ts} (81%) rename core/typed-nocodb-api/example/{index.js => index.ts} (75%) rename core/typed-templates/example/{index.js => index.ts} (95%) rename core/types-lhci/example/{index.js => index.ts} (71%) diff --git a/.config/autoreadmerc.json b/.config/autoreadmerc.json index 1cb250ef..dade5dcf 100644 --- a/.config/autoreadmerc.json +++ b/.config/autoreadmerc.json @@ -1,6 +1,6 @@ { "$schema": "../node_modules/@stephansama/auto-readme/dist/schema.json", - "usageFile": "./example/index.js", + "usageFile": "./example/index.ts", "collapseHeadings": ["Configuration File", "Schema"], "badgeOptions": { "templates": [ diff --git a/core/eslint-config/README.md b/core/eslint-config/README.md index 6d15d76c..af046922 100644 --- a/core/eslint-config/README.md +++ b/core/eslint-config/README.md @@ -145,7 +145,7 @@ export default config({ ## Usage -```javascript +```typescript import { config, presets } from "@stephansama/eslint-config"; const loadConfig = async () => diff --git a/core/eslint-config/example/index.js b/core/eslint-config/example/index.ts similarity index 100% rename from core/eslint-config/example/index.js rename to core/eslint-config/example/index.ts diff --git a/core/eslint-config/tsconfig.json b/core/eslint-config/tsconfig.json index 93b3622e..ff7c5cb0 100644 --- a/core/eslint-config/tsconfig.json +++ b/core/eslint-config/tsconfig.json @@ -1,6 +1,6 @@ { "extends": ["../../tsconfig.base.json"], - "include": ["src", "types", "tsdown.config.ts"], + "include": ["src", "types", "tsdown.config.ts", "example"], "compilerOptions": { "paths": { "@/*": ["./src/*"] diff --git a/core/pnpm-hooks/README.md b/core/pnpm-hooks/README.md index 4fc94661..95221b07 100644 --- a/core/pnpm-hooks/README.md +++ b/core/pnpm-hooks/README.md @@ -110,11 +110,10 @@ Given a dependency manifest like this: ## Usage -```javascript -import { readPackageHooks } from "@stephansama/pnpm-hooks"; +```typescript +import { readPackageHooks, type types } from "@stephansama/pnpm-hooks"; -/** @type {import("../dist/index.mjs").types.PnpmFileHooks} */ export const hooks = { readPackage: readPackageHooks.pinAllDependencies, -}; +} satisfies types.PnpmFileHooks; ``` diff --git a/core/pnpm-hooks/example/index.js b/core/pnpm-hooks/example/index.js deleted file mode 100644 index e31bd5ec..00000000 --- a/core/pnpm-hooks/example/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import { readPackageHooks } from "../dist/index.mjs"; - -/** @type {import("../dist/index.mjs").types.PnpmFileHooks} */ -export const hooks = { - readPackage: readPackageHooks.pinAllDependencies, -}; diff --git a/core/pnpm-hooks/example/index.ts b/core/pnpm-hooks/example/index.ts new file mode 100644 index 00000000..b758cc5a --- /dev/null +++ b/core/pnpm-hooks/example/index.ts @@ -0,0 +1,5 @@ +import { readPackageHooks, type types } from "../dist/index.mjs"; + +export const hooks = { + readPackage: readPackageHooks.pinAllDependencies, +} satisfies types.PnpmFileHooks; diff --git a/core/pnpm-hooks/tsconfig.json b/core/pnpm-hooks/tsconfig.json index eac3f4e7..ae17c25a 100644 --- a/core/pnpm-hooks/tsconfig.json +++ b/core/pnpm-hooks/tsconfig.json @@ -1,4 +1,4 @@ { "extends": ["../../tsconfig.base.json"], - "include": ["./src/**/*", "tsdown.config.ts"] + "include": ["./src/**/*", "tsdown.config.ts", "example"] } diff --git a/core/prettier-plugin-handlebars/README.md b/core/prettier-plugin-handlebars/README.md index 72f3f137..803fc433 100644 --- a/core/prettier-plugin-handlebars/README.md +++ b/core/prettier-plugin-handlebars/README.md @@ -37,11 +37,12 @@ pnpm install @stephansama/prettier-plugin-handlebars ## Usage -```javascript +```typescript +import type { Config } from "prettier"; + import prettierPluginHandlebars from "@stephansama/prettier-plugin-handlebars"; -/** @type {import("prettier").Config} */ export default { plugins: [prettierPluginHandlebars], -}; +} satisfies Config; ``` diff --git a/core/prettier-plugin-handlebars/example/index.js b/core/prettier-plugin-handlebars/example/index.ts similarity index 65% rename from core/prettier-plugin-handlebars/example/index.js rename to core/prettier-plugin-handlebars/example/index.ts index 2f8844e1..166ee38c 100644 --- a/core/prettier-plugin-handlebars/example/index.js +++ b/core/prettier-plugin-handlebars/example/index.ts @@ -1,6 +1,7 @@ +import type { Config } from "prettier"; + import prettierPluginHandlebars from "../dist/index.cjs"; -/** @type {import("prettier").Config} */ export default { plugins: [prettierPluginHandlebars], -}; +} satisfies Config; diff --git a/core/prettier-plugin-handlebars/tsconfig.json b/core/prettier-plugin-handlebars/tsconfig.json index ec5a693b..6a89130a 100644 --- a/core/prettier-plugin-handlebars/tsconfig.json +++ b/core/prettier-plugin-handlebars/tsconfig.json @@ -1,6 +1,6 @@ { "extends": ["../../tsconfig.base.json"], - "include": ["./src/**/*", "./tests/**/*", "tsdown.config.ts"], + "include": ["./src/**/*", "./tests/**/*", "tsdown.config.ts", "example"], "compilerOptions": { "composite": true, "types": ["node"] diff --git a/core/remark-asciinema/README.md b/core/remark-asciinema/README.md index 801016f8..42231618 100644 --- a/core/remark-asciinema/README.md +++ b/core/remark-asciinema/README.md @@ -55,10 +55,10 @@ pnpm install @stephansama/remark-asciinema ## Usage -```javascript +```typescript import { remark } from "remark"; -import asciinema from "@stephansama/remark-asciinema"; +import asciinema from "../dist/index.mjs"; export async function pipeline() { const file = await remark() diff --git a/core/remark-asciinema/example/index.js b/core/remark-asciinema/example/index.ts similarity index 84% rename from core/remark-asciinema/example/index.js rename to core/remark-asciinema/example/index.ts index fe98d9bb..ed01ba79 100644 --- a/core/remark-asciinema/example/index.js +++ b/core/remark-asciinema/example/index.ts @@ -1,6 +1,6 @@ import { remark } from "remark"; -import asciinema from "../dist/index.cjs"; +import asciinema from "../dist/index.mjs"; export async function pipeline() { const file = await remark() diff --git a/core/remark-asciinema/tsconfig.json b/core/remark-asciinema/tsconfig.json index fe05502d..3f2ce638 100644 --- a/core/remark-asciinema/tsconfig.json +++ b/core/remark-asciinema/tsconfig.json @@ -1,6 +1,6 @@ { "extends": ["../../tsconfig.base.json"], - "include": ["./src/**/*", "tsdown.config.ts"], + "include": ["./src/**/*", "tsdown.config.ts", "example"], "compilerOptions": { "types": ["node"], "composite": true diff --git a/core/single-file/README.md b/core/single-file/README.md index 19d8e9fd..a227adac 100644 --- a/core/single-file/README.md +++ b/core/single-file/README.md @@ -59,7 +59,7 @@ npx @stephansama/single-file -v ## Usage -```javascript +```typescript import * as singleFile from "@stephansama/single-file"; export async function useAPI() { diff --git a/core/single-file/example/index.js b/core/single-file/example/index.ts similarity index 100% rename from core/single-file/example/index.js rename to core/single-file/example/index.ts diff --git a/core/single-file/tsconfig.json b/core/single-file/tsconfig.json index 6d9a39aa..1c3d00fc 100644 --- a/core/single-file/tsconfig.json +++ b/core/single-file/tsconfig.json @@ -1,6 +1,6 @@ { "extends": ["../../tsconfig.base.json"], - "include": ["src", "tsdown.config.ts", "cli.mjs"], + "include": ["src", "tsdown.config.ts", "cli.mjs", "example"], "compilerOptions": { "composite": true } diff --git a/core/typed-env/README.md b/core/typed-env/README.md index a66a1172..cfe27ee1 100644 --- a/core/typed-env/README.md +++ b/core/typed-env/README.md @@ -39,9 +39,7 @@ pnpm install @stephansama/typed-env ## Usage -is already a namespace import - -```javascript +```typescript import * as z from "zod"; import { createEnvironment } from "@stephansama/typed-env"; diff --git a/core/typed-env/example/index.js b/core/typed-env/example/index.ts similarity index 78% rename from core/typed-env/example/index.js rename to core/typed-env/example/index.ts index bb0bda9b..2c192ff1 100644 --- a/core/typed-env/example/index.js +++ b/core/typed-env/example/index.ts @@ -1,6 +1,3 @@ -// is already a namespace import -// remark-usage-ignore-next -// eslint-disable-next-line zod/consistent-import import * as z from "zod"; import { createEnvironment } from "../dist/index.mjs"; diff --git a/core/typed-env/tsconfig.json b/core/typed-env/tsconfig.json index fe05502d..3f2ce638 100644 --- a/core/typed-env/tsconfig.json +++ b/core/typed-env/tsconfig.json @@ -1,6 +1,6 @@ { "extends": ["../../tsconfig.base.json"], - "include": ["./src/**/*", "tsdown.config.ts"], + "include": ["./src/**/*", "tsdown.config.ts", "example"], "compilerOptions": { "types": ["node"], "composite": true diff --git a/core/typed-events/README.md b/core/typed-events/README.md index a506f4d0..d2d80dca 100644 --- a/core/typed-events/README.md +++ b/core/typed-events/README.md @@ -46,6 +46,12 @@ pnpm install @stephansama/typed-events ## Usage +```typescript +/* eslint-disable perfectionist/sort-modules */ + +import * as z from "zod"; +``` + ### createEvent create a typed [`CustomEvent`](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent) @@ -53,7 +59,7 @@ using a [standard-schema](https://github.com/standard-schema/standard-schema) co
open example -```javascript +```typescript import { createEvent } from "@stephansama/typed-events"; export const customAnimationEvent = createEvent( @@ -67,13 +73,15 @@ export const customAnimationEvent = createEvent( somewhere in your codebase -```javascript +```typescript export function listenForAnimationEvent() { - const item = document.querySelector("#item"); + const item = document.querySelector("#item"); + + if (!item) throw new Error("unable to find item"); const cleanup = customAnimationEvent.listen((event) => { - item.style.x = event.data.x; - item.style.y = event.data.y; + item.style.x = String(event.data.x); + item.style.y = String(event.data.y); }); return () => cleanup(); @@ -82,14 +90,17 @@ export function listenForAnimationEvent() { somewhere else in your codebase -```javascript +```typescript export function dispatchEvent() { + const button = document.querySelector("#button"); const x = document.querySelector("#x"); const y = document.querySelector("#y"); - const button = document.querySelector("#button"); + if (!button) throw new Error("unable to find button"); + if (!x) throw new Error("unable to find x"); + if (!y) throw new Error("unable to find y"); - button.addEventListener("click", () => { + button?.addEventListener("click", () => { customAnimationEvent.dispatch({ x: +x.textContent, y: +y.textContent, @@ -104,7 +115,7 @@ export function dispatchEvent() {
open example -```javascript +```typescript import { createEventMap } from "@stephansama/typed-events"; export const eventMap = createEventMap("event-map", { @@ -115,12 +126,13 @@ export const eventMap = createEventMap("event-map", { somewhere in your codebase -```javascript +```typescript export function listenForEventMap() { const value = document.querySelector("#value"); + if (!value) throw new Error("unable to find value"); const cleanup = eventMap.listen("update", (message) => { - value.textContent = message.data.value; + value.textContent = String(message.data.value); }); return () => cleanup(); @@ -129,9 +141,10 @@ export function listenForEventMap() { somewhere else in your codebase -```javascript +```typescript export function dispatchEventMap() { const button = document.querySelector("#button"); + if (!button) throw new Error("unable to find button"); button.addEventListener("click", () => { eventMap.dispatch("update", { @@ -150,7 +163,7 @@ using a [standard-schema](https://github.com/standard-schema/standard-schema) co
open example -```javascript +```typescript import { createBroadcastChannel } from "@stephansama/typed-events"; export const channel = createBroadcastChannel("broadcaster", { @@ -161,12 +174,13 @@ export const channel = createBroadcastChannel("broadcaster", { somewhere in your codebase -```javascript +```typescript export function listenForChannelMessage() { const value = document.querySelector("#value"); + if (!value) throw new Error("unable to find value"); const cleanup = channel.listen("update", (message) => { - value.textContent = message.data.value; + value.textContent = String(message.data.value); }); return () => cleanup(); @@ -175,9 +189,10 @@ export function listenForChannelMessage() { somewhere else in your codebase -```javascript +```typescript export function dispatchChannelMessage() { const button = document.querySelector("#button"); + if (!button) throw new Error("unable to find button"); button.addEventListener("click", () => { channel.dispatch("update", { @@ -197,7 +212,7 @@ using a [standard-schema](https://github.com/standard-schema/standard-schema) co
open example -```javascript +```typescript import { createBroadcastEvent } from "@stephansama/typed-events"; export const broadcastEvent = createBroadcastEvent("broadcaster", { @@ -208,12 +223,13 @@ export const broadcastEvent = createBroadcastEvent("broadcaster", { somewhere in your codebase -```javascript +```typescript export function listenForBroadcastEvent() { const value = document.querySelector("#value"); + if (!value) throw new Error("unable to find value"); const cleanup = broadcastEvent.listen("update", (message) => { - value.textContent = message.data.value; + value.textContent = String(message.data.value); }); return () => cleanup(); @@ -222,9 +238,10 @@ export function listenForBroadcastEvent() { somewhere else in your codebase -```javascript +```typescript export function dispatchBroadcastEvent() { const button = document.querySelector("#button"); + if (!button) throw new Error("unable to find button"); button.addEventListener("click", () => { broadcastEvent.dispatch("update", { @@ -243,7 +260,7 @@ using a [standard-schema](https://github.com/standard-schema/standard-schema) co
open example -```javascript +```typescript import { createMessage } from "@stephansama/typed-events"; export const message = createMessage("event-map", { @@ -254,12 +271,13 @@ export const message = createMessage("event-map", { somewhere in your codebase -```javascript +```typescript export function listenForMessage() { const value = document.querySelector("#value"); + if (!value) throw new Error("unable to find value"); const cleanup = message.listen("update", (message) => { - value.textContent = message.data.value; + value.textContent = String(message.data.value); }); return () => cleanup(); @@ -268,9 +286,10 @@ export function listenForMessage() { somewhere else in your codebase -```javascript +```typescript export function dispatchMessage() { const button = document.querySelector("#button"); + if (!button) throw new Error("unable to find button"); button.addEventListener("click", () => { message.dispatch("update", { @@ -288,21 +307,25 @@ you can use `useListener` or `useListeners` to automatically register and cleanu
open example -```javascript +```typescript import { useListeners } from "../dist/react.mjs"; const map = createBroadcastEvent("react-example", { - first: z.object({}), - second: z.object({ payload: z.number() }), + first: z.object({}), + second: z.object({ payload: z.number() }), }); export function ExampleComponent() { - useListeners(map, { - first: () => console.info("first event happened"), - second: ({ data }) => console.info(data.payload), - }); + useListeners(map, { + first(_payload) { +``` + +```typescript + }, + second(_payload) {}, + }); - return; // more jsx... + return; // more jsx... } ``` diff --git a/core/typed-events/example/index.js b/core/typed-events/example/index.ts similarity index 81% rename from core/typed-events/example/index.js rename to core/typed-events/example/index.ts index 49a63f53..66646e00 100644 --- a/core/typed-events/example/index.js +++ b/core/typed-events/example/index.ts @@ -1,6 +1,5 @@ -// remark-usage-ignore-next -/* eslint-disable perfectionist/sort-modules, import-x/no-duplicates, zod/consistent-import */ -// remark-usage-ignore-next +/* eslint-disable perfectionist/sort-modules */ + import * as z from "zod"; // ### createEvent @@ -21,11 +20,13 @@ export const customAnimationEvent = createEvent( // somewhere in your codebase export function listenForAnimationEvent() { - const item = document.querySelector("#item"); + const item = document.querySelector("#item"); + + if (!item) throw new Error("unable to find item"); const cleanup = customAnimationEvent.listen((event) => { - item.style.x = event.data.x; - item.style.y = event.data.y; + item.style.x = String(event.data.x); + item.style.y = String(event.data.y); }); return () => cleanup(); @@ -33,12 +34,15 @@ export function listenForAnimationEvent() { // somewhere else in your codebase export function dispatchEvent() { + const button = document.querySelector("#button"); const x = document.querySelector("#x"); const y = document.querySelector("#y"); - const button = document.querySelector("#button"); + if (!button) throw new Error("unable to find button"); + if (!x) throw new Error("unable to find x"); + if (!y) throw new Error("unable to find y"); - button.addEventListener("click", () => { + button?.addEventListener("click", () => { customAnimationEvent.dispatch({ x: +x.textContent, y: +y.textContent, @@ -61,9 +65,10 @@ export const eventMap = createEventMap("event-map", { // somewhere in your codebase export function listenForEventMap() { const value = document.querySelector("#value"); + if (!value) throw new Error("unable to find value"); const cleanup = eventMap.listen("update", (message) => { - value.textContent = message.data.value; + value.textContent = String(message.data.value); }); return () => cleanup(); @@ -72,6 +77,7 @@ export function listenForEventMap() { // somewhere else in your codebase export function dispatchEventMap() { const button = document.querySelector("#button"); + if (!button) throw new Error("unable to find button"); button.addEventListener("click", () => { eventMap.dispatch("update", { @@ -97,9 +103,10 @@ export const channel = createBroadcastChannel("broadcaster", { // somewhere in your codebase export function listenForChannelMessage() { const value = document.querySelector("#value"); + if (!value) throw new Error("unable to find value"); const cleanup = channel.listen("update", (message) => { - value.textContent = message.data.value; + value.textContent = String(message.data.value); }); return () => cleanup(); @@ -108,6 +115,7 @@ export function listenForChannelMessage() { // somewhere else in your codebase export function dispatchChannelMessage() { const button = document.querySelector("#button"); + if (!button) throw new Error("unable to find button"); button.addEventListener("click", () => { channel.dispatch("update", { @@ -134,9 +142,10 @@ export const broadcastEvent = createBroadcastEvent("broadcaster", { // somewhere in your codebase export function listenForBroadcastEvent() { const value = document.querySelector("#value"); + if (!value) throw new Error("unable to find value"); const cleanup = broadcastEvent.listen("update", (message) => { - value.textContent = message.data.value; + value.textContent = String(message.data.value); }); return () => cleanup(); @@ -145,6 +154,7 @@ export function listenForBroadcastEvent() { // somewhere else in your codebase export function dispatchBroadcastEvent() { const button = document.querySelector("#button"); + if (!button) throw new Error("unable to find button"); button.addEventListener("click", () => { broadcastEvent.dispatch("update", { @@ -170,9 +180,10 @@ export const message = createMessage("event-map", { // somewhere in your codebase export function listenForMessage() { const value = document.querySelector("#value"); + if (!value) throw new Error("unable to find value"); const cleanup = message.listen("update", (message) => { - value.textContent = message.data.value; + value.textContent = String(message.data.value); }); return () => cleanup(); @@ -181,6 +192,7 @@ export function listenForMessage() { // somewhere else in your codebase export function dispatchMessage() { const button = document.querySelector("#button"); + if (!button) throw new Error("unable to find button"); button.addEventListener("click", () => { message.dispatch("update", { @@ -204,8 +216,10 @@ const map = createBroadcastEvent("react-example", { export function ExampleComponent() { useListeners(map, { - first: () => console.info("first event happened"), - second: ({ data }) => console.info(data.payload), + first(_payload) { + // + }, + second(_payload) {}, }); return; // more jsx... diff --git a/core/typed-events/tsconfig.json b/core/typed-events/tsconfig.json index 5ef7b548..0a83d5cc 100644 --- a/core/typed-events/tsconfig.json +++ b/core/typed-events/tsconfig.json @@ -1,6 +1,6 @@ { "extends": ["../../tsconfig.base.json"], - "include": ["./src/**/*", "vitest.config.ts", "tsdown.config.ts"], + "include": ["./src/**/*", "vitest.config.ts", "tsdown.config.ts", "example"], "compilerOptions": { "paths": { "@/*": ["./src/*"] diff --git a/core/typed-nocodb-api/README.md b/core/typed-nocodb-api/README.md index 6e0321b5..4ae3024b 100644 --- a/core/typed-nocodb-api/README.md +++ b/core/typed-nocodb-api/README.md @@ -37,13 +37,13 @@ pnpm install @stephansama/typed-nocodb-api ## Usage -```javascript +```typescript import * as z from "zod"; import { createApi } from "@stephansama/typed-nocodb-api"; const api = createApi({ - baseId: process.env.NOCODB_BASE, + baseId: process.env.NOCODB_BASE!, origin: "https://nocodb.com", schema: z.object({ column1: z.string().trim(), @@ -51,7 +51,7 @@ const api = createApi({ column3: z.number(), column4: z.boolean(), }), - tableId: process.env.NOCODB_TABLE, + tableId: process.env.NOCODB_TABLE!, token: process.env.NOCODB_TOKEN, }); diff --git a/core/typed-nocodb-api/example/index.js b/core/typed-nocodb-api/example/index.ts similarity index 75% rename from core/typed-nocodb-api/example/index.js rename to core/typed-nocodb-api/example/index.ts index 935b4f01..28e90f2c 100644 --- a/core/typed-nocodb-api/example/index.js +++ b/core/typed-nocodb-api/example/index.ts @@ -1,11 +1,9 @@ -// remark-usage-ignore-next -// eslint-disable-next-line zod/consistent-import import * as z from "zod"; import { createApi } from "../dist/index.mjs"; const api = createApi({ - baseId: process.env.NOCODB_BASE, + baseId: process.env.NOCODB_BASE!, origin: "https://nocodb.com", schema: z.object({ column1: z.string().trim(), @@ -13,7 +11,7 @@ const api = createApi({ column3: z.number(), column4: z.boolean(), }), - tableId: process.env.NOCODB_TABLE, + tableId: process.env.NOCODB_TABLE!, token: process.env.NOCODB_TOKEN, }); diff --git a/core/typed-nocodb-api/tsconfig.json b/core/typed-nocodb-api/tsconfig.json index 01ecda9f..d65c1f3d 100644 --- a/core/typed-nocodb-api/tsconfig.json +++ b/core/typed-nocodb-api/tsconfig.json @@ -1,6 +1,6 @@ { "extends": ["../../tsconfig.base.json"], - "include": ["./src/**/*", "tsdown.config.ts", "./test/**/*"], + "include": ["./src/**/*", "tsdown.config.ts", "./test/**/*", "example"], "compilerOptions": { "types": ["node"], "composite": true diff --git a/core/typed-templates/README.md b/core/typed-templates/README.md index e6949fb0..f79df177 100644 --- a/core/typed-templates/README.md +++ b/core/typed-templates/README.md @@ -41,7 +41,7 @@ pnpm install @stephansama/typed-templates create a map of different handlebar schemas -```javascript +```typescript import * as z from "zod"; import { @@ -84,7 +84,7 @@ if (isLinting()) await schemaMap.audit(); or create a singleton schema used to validate multiple templates -```javascript +```typescript export const singleSchema = createHandlebarSchemaSingleton( [ "../tests/fixtures/singleton/valid.hbs", @@ -105,7 +105,7 @@ if (isLinting()) await singleSchema.audit(); then later on in the code in another file: -```javascript +```typescript export async function useTemplate() { return await schemaMap.compile("constList", { body: "body", diff --git a/core/typed-templates/example/index.js b/core/typed-templates/example/index.ts similarity index 95% rename from core/typed-templates/example/index.js rename to core/typed-templates/example/index.ts index b6f3aa9c..907d3c02 100644 --- a/core/typed-templates/example/index.js +++ b/core/typed-templates/example/index.ts @@ -1,7 +1,5 @@ // create a map of different handlebar schemas // -// remark-usage-ignore-next -// eslint-disable-next-line zod/consistent-import import * as z from "zod"; import { diff --git a/core/typed-templates/tsconfig.json b/core/typed-templates/tsconfig.json index 6761ab6f..6d002310 100644 --- a/core/typed-templates/tsconfig.json +++ b/core/typed-templates/tsconfig.json @@ -1,6 +1,13 @@ { "extends": ["../../tsconfig.base.json"], - "include": ["src", "types", "tests", "vitest.config.ts", "tsdown.config.ts"], + "include": [ + "src", + "types", + "tests", + "vitest.config.ts", + "tsdown.config.ts", + "example" + ], "compilerOptions": { "types": ["node"], "paths": { diff --git a/core/types-lhci/README.md b/core/types-lhci/README.md index 665e7c6c..c7a60ec4 100644 --- a/core/types-lhci/README.md +++ b/core/types-lhci/README.md @@ -37,10 +37,9 @@ pnpm install @stephansama/types-lhci ## Usage -```javascript -import { lhciSchema } from "@stephansama/types-lhci"; +```typescript +import { lhciSchema, type LhciSchema } from "@stephansama/types-lhci"; -/** @type {import("../dist/index.mjs").LhciSchema} */ const config = { ci: { upload: { @@ -50,11 +49,11 @@ const config = { token: "project-token", }, }, -}; +} satisfies LhciSchema; ``` you can also verify the config object later -```javascript +```typescript lhciSchema.parse(config); ``` diff --git a/core/types-lhci/__snapshots__/tsnapi/index.snapshot.d.ts b/core/types-lhci/__snapshots__/tsnapi/index.snapshot.d.ts index e8a0b0f4..64c9813e 100644 --- a/core/types-lhci/__snapshots__/tsnapi/index.snapshot.d.ts +++ b/core/types-lhci/__snapshots__/tsnapi/index.snapshot.d.ts @@ -136,16 +136,16 @@ export declare const lhciSchema: z.ZodObject<{ }, z.core.$strip>; }, z.core.$strip>>; upload: z.ZodOptional>; - extraHeaders: z.ZodOptional>; - ignoreDuplicateBuildFailure: z.ZodOptional; - serverBaseUrl: z.ZodDefault; - target: z.ZodLiteral<"lhci">; - token: z.ZodString; - urlReplacementPatterns: z.ZodDefault>; + }, z.core.$strip>>>; + extraHeaders: z.ZodOptional>>; + ignoreDuplicateBuildFailure: z.ZodOptional>; + serverBaseUrl: z.ZodOptional>; + target: z.ZodOptional>; + token: z.ZodOptional; + urlReplacementPatterns: z.ZodOptional>>; }, z.core.$strip>, z.ZodObject<{ outputDir: z.ZodString; reportFilenamePattern: z.ZodDefault; @@ -154,10 +154,10 @@ export declare const lhciSchema: z.ZodObject<{ target: z.ZodLiteral<"temporary-public-storage">; uploadUrlMap: z.ZodDefault; }, z.core.$strip>], "target">, z.ZodObject<{ - githubApiHost: z.ZodDefault; - githubAppToken: z.ZodOptional; - githubStatusContextSuffix: z.ZodOptional; - githubToken: z.ZodOptional; + githubApiHost: z.ZodOptional>; + githubAppToken: z.ZodOptional>; + githubStatusContextSuffix: z.ZodOptional>; + githubToken: z.ZodOptional>; }, z.core.$strip>>>; wizard: z.ZodOptional; @@ -191,16 +191,16 @@ export declare const lhciServerSchema: z.ZodObject<{ }, z.core.$strip>; }, z.core.$strip>; export declare const lhciUploadSchema: z.ZodIntersection>; - extraHeaders: z.ZodOptional>; - ignoreDuplicateBuildFailure: z.ZodOptional; - serverBaseUrl: z.ZodDefault; - target: z.ZodLiteral<"lhci">; - token: z.ZodString; - urlReplacementPatterns: z.ZodDefault>; + }, z.core.$strip>>>; + extraHeaders: z.ZodOptional>>; + ignoreDuplicateBuildFailure: z.ZodOptional>; + serverBaseUrl: z.ZodOptional>; + target: z.ZodOptional>; + token: z.ZodOptional; + urlReplacementPatterns: z.ZodOptional>>; }, z.core.$strip>, z.ZodObject<{ outputDir: z.ZodString; reportFilenamePattern: z.ZodDefault; @@ -209,10 +209,10 @@ export declare const lhciUploadSchema: z.ZodIntersection; uploadUrlMap: z.ZodDefault; }, z.core.$strip>], "target">, z.ZodObject<{ - githubApiHost: z.ZodDefault; - githubAppToken: z.ZodOptional; - githubStatusContextSuffix: z.ZodOptional; - githubToken: z.ZodOptional; + githubApiHost: z.ZodOptional>; + githubAppToken: z.ZodOptional>; + githubStatusContextSuffix: z.ZodOptional>; + githubToken: z.ZodOptional>; }, z.core.$strip>>; export declare const lhciWizardSchema: z.ZodObject<{ extraHeaders: z.ZodOptional; diff --git a/core/types-lhci/example/index.js b/core/types-lhci/example/index.ts similarity index 71% rename from core/types-lhci/example/index.js rename to core/types-lhci/example/index.ts index 5eb2d7da..0498fb14 100644 --- a/core/types-lhci/example/index.js +++ b/core/types-lhci/example/index.ts @@ -1,6 +1,5 @@ -import { lhciSchema } from "../dist/index.mjs"; +import { lhciSchema, type LhciSchema } from "../dist/index.mjs"; -/** @type {import("../dist/index.mjs").LhciSchema} */ const config = { ci: { upload: { @@ -10,7 +9,7 @@ const config = { token: "project-token", }, }, -}; +} satisfies LhciSchema; // you can also verify the config object later diff --git a/core/types-lhci/src/index.ts b/core/types-lhci/src/index.ts index 134977ac..6eee70dc 100644 --- a/core/types-lhci/src/index.ts +++ b/core/types-lhci/src/index.ts @@ -85,20 +85,27 @@ export const lhciCollectSchema = z.object({ export type LhciUploadSchema = z.infer; export const lhciUploadSchema = z .discriminatedUnion("target", [ - z.object({ - basicAuth: lhciBasicAuthSchema.optional(), - extraHeaders: z.record(z.string(), z.string().trim()).optional(), - ignoreDuplicateBuildFailure: z.boolean().optional(), - serverBaseUrl: z.string().trim().default("http://localhost:9001/"), - target: z.literal("lhci"), - token: z.string().trim(), - urlReplacementPatterns: z - .array(z.string().trim()) - .default([ - "s#:[0-9]{3,5}/#:PORT/#", - "s/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/UUID/ig", - ]), - }), + z + .object({ + basicAuth: lhciBasicAuthSchema.optional(), + extraHeaders: z + .record(z.string(), z.string().trim()) + .optional(), + ignoreDuplicateBuildFailure: z.boolean().optional(), + serverBaseUrl: z + .string() + .trim() + .default("http://localhost:9001/"), + target: z.literal("lhci"), + token: z.string().trim(), + urlReplacementPatterns: z + .array(z.string().trim()) + .default([ + "s#:[0-9]{3,5}/#:PORT/#", + "s/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/UUID/ig", + ]), + }) + .partial(), z.object({ outputDir: z.string().trim(), reportFilenamePattern: z @@ -115,12 +122,17 @@ export const lhciUploadSchema = z }), ]) .and( - z.object({ - githubApiHost: z.string().trim().default("https://api.github.com"), - githubAppToken: z.string().trim().optional(), - githubStatusContextSuffix: z.string().trim().optional(), - githubToken: z.string().trim().optional(), - }), + z + .object({ + githubApiHost: z + .string() + .trim() + .default("https://api.github.com"), + githubAppToken: z.string().trim().optional(), + githubStatusContextSuffix: z.string().trim().optional(), + githubToken: z.string().trim().optional(), + }) + .partial(), ); export type LhciServerSchema = z.infer; diff --git a/core/types-lhci/tsconfig.json b/core/types-lhci/tsconfig.json index c515776b..d4ccf031 100644 --- a/core/types-lhci/tsconfig.json +++ b/core/types-lhci/tsconfig.json @@ -1,8 +1,8 @@ { "extends": ["../../tsconfig.base.json"], + "include": ["./src/**/*", "tsdown.config.ts", "types", "example"], "compilerOptions": { "composite": true, "types": ["node"] - }, - "include": ["./src/**/*", "tsdown.config.ts", "types"] + } } From 8b2fb28de009699ce29260693b81d612a15b8ab6 Mon Sep 17 00:00:00 2001 From: stephansama Date: Sat, 16 May 2026 15:12:26 -0400 Subject: [PATCH 3/8] build: update import path to use cjs instead of mjs --- core/remark-asciinema/README.md | 2 +- core/remark-asciinema/example/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/remark-asciinema/README.md b/core/remark-asciinema/README.md index 42231618..ad844005 100644 --- a/core/remark-asciinema/README.md +++ b/core/remark-asciinema/README.md @@ -58,7 +58,7 @@ pnpm install @stephansama/remark-asciinema ```typescript import { remark } from "remark"; -import asciinema from "../dist/index.mjs"; +import asciinema from "@stephansama/remark-asciinema"; export async function pipeline() { const file = await remark() diff --git a/core/remark-asciinema/example/index.ts b/core/remark-asciinema/example/index.ts index ed01ba79..fe98d9bb 100644 --- a/core/remark-asciinema/example/index.ts +++ b/core/remark-asciinema/example/index.ts @@ -1,6 +1,6 @@ import { remark } from "remark"; -import asciinema from "../dist/index.mjs"; +import asciinema from "../dist/index.cjs"; export async function pipeline() { const file = await remark() From 0c8b9ed394f28111038203a887e84b36d5fb542c Mon Sep 17 00:00:00 2001 From: stephansama Date: Sat, 16 May 2026 15:13:17 -0400 Subject: [PATCH 4/8] fix(core): remove optional chaining from event listener --- core/typed-events/README.md | 2 +- core/typed-events/example/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/typed-events/README.md b/core/typed-events/README.md index d2d80dca..7570e3f0 100644 --- a/core/typed-events/README.md +++ b/core/typed-events/README.md @@ -100,7 +100,7 @@ export function dispatchEvent() { if (!x) throw new Error("unable to find x"); if (!y) throw new Error("unable to find y"); - button?.addEventListener("click", () => { + button.addEventListener("click", () => { customAnimationEvent.dispatch({ x: +x.textContent, y: +y.textContent, diff --git a/core/typed-events/example/index.ts b/core/typed-events/example/index.ts index 66646e00..0a9ab973 100644 --- a/core/typed-events/example/index.ts +++ b/core/typed-events/example/index.ts @@ -42,7 +42,7 @@ export function dispatchEvent() { if (!x) throw new Error("unable to find x"); if (!y) throw new Error("unable to find y"); - button?.addEventListener("click", () => { + button.addEventListener("click", () => { customAnimationEvent.dispatch({ x: +x.textContent, y: +y.textContent, From 42e3c38bb3e399706150d08dfba879c500093cf8 Mon Sep 17 00:00:00 2001 From: stephansama Date: Sat, 16 May 2026 15:15:23 -0400 Subject: [PATCH 5/8] docs(core): remove eslint disable and add remark-usage-ignore-next --- core/typed-events/README.md | 6 ------ core/typed-events/example/index.ts | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/core/typed-events/README.md b/core/typed-events/README.md index 7570e3f0..bf04b5d1 100644 --- a/core/typed-events/README.md +++ b/core/typed-events/README.md @@ -46,12 +46,6 @@ pnpm install @stephansama/typed-events ## Usage -```typescript -/* eslint-disable perfectionist/sort-modules */ - -import * as z from "zod"; -``` - ### createEvent create a typed [`CustomEvent`](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent) diff --git a/core/typed-events/example/index.ts b/core/typed-events/example/index.ts index 0a9ab973..463acbc9 100644 --- a/core/typed-events/example/index.ts +++ b/core/typed-events/example/index.ts @@ -1,5 +1,6 @@ +// remark-usage-ignore-next /* eslint-disable perfectionist/sort-modules */ - +// remark-usage-ignore-next import * as z from "zod"; // ### createEvent From f8fd0ec6aa1f02b717f8f163adeb1f05b63d8b7d Mon Sep 17 00:00:00 2001 From: stephansama Date: Sat, 16 May 2026 15:16:37 -0400 Subject: [PATCH 6/8] fix(lhci): require target in lhciUploadSchema --- core/types-lhci/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/types-lhci/src/index.ts b/core/types-lhci/src/index.ts index 6eee70dc..350f9367 100644 --- a/core/types-lhci/src/index.ts +++ b/core/types-lhci/src/index.ts @@ -105,7 +105,8 @@ export const lhciUploadSchema = z "s/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/UUID/ig", ]), }) - .partial(), + .partial() + .required({ target: true }), z.object({ outputDir: z.string().trim(), reportFilenamePattern: z From 76db3c0006a0146b54a0db8945825527a8676e01 Mon Sep 17 00:00:00 2001 From: stephansama Date: Sat, 16 May 2026 15:18:22 -0400 Subject: [PATCH 7/8] chore(dependencies): update to use homebrew instead of github links --- .changeset/full-items-stick.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/full-items-stick.md diff --git a/.changeset/full-items-stick.md b/.changeset/full-items-stick.md new file mode 100644 index 00000000..2adabafc --- /dev/null +++ b/.changeset/full-items-stick.md @@ -0,0 +1,5 @@ +--- +"@stephansama/auto-readme": minor +--- + +updated dependencies to not use github link instead using homebrew packages From 46d253ef6662bdd4878ae941546a1fa253cadb2b Mon Sep 17 00:00:00 2001 From: stephansama Date: Sat, 16 May 2026 15:19:27 -0400 Subject: [PATCH 8/8] perf(types-lhci): make target non-optional in schema --- core/types-lhci/__snapshots__/tsnapi/index.snapshot.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/types-lhci/__snapshots__/tsnapi/index.snapshot.d.ts b/core/types-lhci/__snapshots__/tsnapi/index.snapshot.d.ts index 64c9813e..92db5e96 100644 --- a/core/types-lhci/__snapshots__/tsnapi/index.snapshot.d.ts +++ b/core/types-lhci/__snapshots__/tsnapi/index.snapshot.d.ts @@ -143,7 +143,7 @@ export declare const lhciSchema: z.ZodObject<{ extraHeaders: z.ZodOptional>>; ignoreDuplicateBuildFailure: z.ZodOptional>; serverBaseUrl: z.ZodOptional>; - target: z.ZodOptional>; + target: z.ZodNonOptional>>; token: z.ZodOptional; urlReplacementPatterns: z.ZodOptional>>; }, z.core.$strip>, z.ZodObject<{ @@ -198,7 +198,7 @@ export declare const lhciUploadSchema: z.ZodIntersection>>; ignoreDuplicateBuildFailure: z.ZodOptional>; serverBaseUrl: z.ZodOptional>; - target: z.ZodOptional>; + target: z.ZodNonOptional>>; token: z.ZodOptional; urlReplacementPatterns: z.ZodOptional>>; }, z.core.$strip>, z.ZodObject<{