@jfalava/ts-standard 0.3.7 → 0.3.8

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/docs/workflows.md CHANGED
@@ -1,14 +1,15 @@
1
1
  # Workflow rules
2
2
 
3
- | Rule | Checks |
4
- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5
- | `workflows/ci-reference` | A public repo has `ci.yml` and a private one does not. `ci.yml` equals `reference/ci.yml` once the additions in `ci` are taken out, ignoring action refs. Filter differences name the pattern. |
6
- | `workflows/actions-pinned` | Every `uses:` outside the repo is pinned to a 40-character SHA with a `# v…` comment. |
7
- | `workflows/reference-pins` | Warning. An action the reference also uses is at the reference's SHA. |
8
- | `workflows/dependabot` | `.github/dependabot.yml` has a `github-actions` entry. |
9
- | `workflows/hygiene` | Every workflow has top-level `permissions` and a `concurrency` group (reusable workflows excepted), and every job that runs steps has `timeout-minutes`. |
10
- | `workflows/bun-from-package-manager` | No `setup-bun` step sets `bun-version`. |
11
- | `workflows/scripts-only` | `run:` steps call bun only as `bun install --frozen-lockfile` or `bun run <script>`, never `bunx`, and never `--ignore-scripts`. |
12
- | `workflows/release-check` | A tag-triggered workflow runs `bun run check`. |
13
- | `workflows/release-version` | A tag-triggered workflow checks the tag against the package version (`${GITHUB_REF_NAME#v}`). |
14
- | `workflows/release-build` | A tag-triggered workflow calls `build:<target>` scripts, and every matrix target exists as a script in the package it runs in. |
3
+ | Rule | Checks |
4
+ | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5
+ | `workflows/ci-reference` | A public repo has `ci.yml` and a private one does not. `ci.yml` equals `reference/ci.yml` once the additions in `ci` are taken out, ignoring action refs. Filter differences name the pattern. |
6
+ | `workflows/actions-pinned` | Every `uses:` outside the repo is pinned to a 40-character SHA with a `# v…` comment. |
7
+ | `workflows/reference-pins` | Warning. An action the reference also uses is at the reference's SHA. |
8
+ | `workflows/dependabot` | `.github/dependabot.yml` has a `github-actions` entry. |
9
+ | `workflows/hygiene` | Every workflow has top-level `permissions` and a `concurrency` group (reusable workflows excepted), and every job that runs steps has `timeout-minutes`. |
10
+ | `workflows/bun-from-package-manager` | No `setup-bun` step sets `bun-version`. |
11
+ | `workflows/scripts-only` | `run:` steps call bun only as `bun install --frozen-lockfile` or `bun run <script>`, never `bunx`, and never `--ignore-scripts`. |
12
+ | `workflows/release-trigger` | A release workflow triggers on `push: tags: ["v*"]` and nothing else. A workflow is a release workflow when it is named `release.yml` or `<prefix>-release.yml`, is triggered by tags, or publishes (`npm`, `bun`, `pnpm` or `yarn publish`, `gh release create`, `softprops/action-gh-release`). |
13
+ | `workflows/release-check` | A tag-triggered workflow runs `bun run check`. |
14
+ | `workflows/release-version` | A tag-triggered workflow checks the tag against the package version (`${GITHUB_REF_NAME#v}`). |
15
+ | `workflows/release-build` | A tag-triggered workflow calls `build:<target>` scripts, and every matrix target exists as a script in the package it runs in. |
@@ -26,7 +26,7 @@
26
26
  "devDependencies": {
27
27
  "@cloudflare/oxlint-config": "0.2.0",
28
28
  "@effect/tsgo": "0.74.1",
29
- "@jfalava/ts-standard": "0.3.7",
29
+ "@jfalava/ts-standard": "0.3.8",
30
30
  "@oxlint/plugins": "1.95.0",
31
31
  "bun-types": "1.4.5",
32
32
  "oxfmt": "0.80.0",
@@ -11,7 +11,7 @@
11
11
  "build": {
12
12
  "@cloudflare/oxlint-config": "0.2.0",
13
13
  "@effect/tsgo": "0.74.1",
14
- "@jfalava/ts-standard": "0.3.7",
14
+ "@jfalava/ts-standard": "0.3.8",
15
15
  "@oxlint/plugins": "1.95.0",
16
16
  "bun-types": "1.4.5",
17
17
  "oxfmt": "0.80.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jfalava/ts-standard",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "Checks a Bun repo against the TypeScript scripts and workflows standard: package.json scripts, pins, tsconfig, lint setup and GitHub workflows. Also ships the anti-slop oxlint plugins the standard uses.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -42,7 +42,7 @@ When `check` used to be a fixer in a repo, update its `AGENTS.md` and README in
42
42
 
43
43
  - Root `prepare` is exactly `effect-tsgo patch --no-typescript --tsrs --oxlint`. It runs on every `bun install`. `--no-typescript` is required when no native `typescript` package is installed, and only Astro and Pulumi packages may depend on `typescript`. Never install with `--ignore-scripts`.
44
44
  - Root `packageManager` is `bun@1.4.5`, the only place the bun version lives. `bun-types` or `@types/bun` uses the same version. Workflows and Workers Builds read it; remove `bun-version:` inputs and `BUN_VERSION` build variables.
45
- - Workspace repos keep tool versions exact in a root catalog and reference them as `catalog:build`. The current set is `@cloudflare/oxlint-config` 0.2.0, `@effect/tsgo` 0.74.1, `@jfalava/ts-standard` 0.3.7, `@oxlint/plugins` 1.95.0, `oxfmt` 0.80.0, `oxlint` 1.95.0, `tsrs` 7.1.0-beta.tsrs5. All seven are root `devDependencies`. Single-package repos use the same exact versions in `devDependencies`. Every dependency is an exact version. No `oxlint-tsgolint`.
45
+ - Workspace repos keep tool versions exact in a root catalog and reference them as `catalog:build`. The current set is `@cloudflare/oxlint-config` 0.2.0, `@effect/tsgo` 0.74.1, `@jfalava/ts-standard` 0.3.8, `@oxlint/plugins` 1.95.0, `oxfmt` 0.80.0, `oxlint` 1.95.0, `tsrs` 7.1.0-beta.tsrs5. All seven are root `devDependencies`. Single-package repos use the same exact versions in `devDependencies`. Every dependency is an exact version. No `oxlint-tsgolint`.
46
46
  - Bump `@effect/tsgo`, `tsrs` and `oxlint` (with `@oxlint/plugins`) in one change; `prepare` fails the install with `UnsupportedTargetPackageVersionError` on an unsupported pair. Take the pins from the examples of the installed ts-standard version, and check npm for newer supported sets before a bump.
47
47
  - `bunfig.toml` sets `minimumReleaseAge = 86400` and lists in `minimumReleaseAgeExcludes`, by exact name, `@jfalava/ts-standard`, `@effect/tsgo` and its seven `@effect/tsgo-<platform>` packages. A scope glob such as `@jfalava/*` excludes nothing.
48
48
  - tsconfig: one base (`tsconfig.base.json` in a workspace repo, `tsconfig.json` otherwise) with `$schema` `./node_modules/@effect/tsgo/schema.json`, `noEmit: true`, `strict`, `noUncheckedIndexedAccess`, and a `plugins` entry named `@effect/language-service`. Without that entry Effect diagnostics are off and typecheck passes on a floating Effect. Each package has one `tsconfig.json` that extends the base, sets no strict flags or `plugins`, and includes its tests; no `tsconfig.test.json`. Never set `ignoreEffectWarningsInTscExitCode`.
package/src/workflows.ts CHANGED
@@ -107,6 +107,24 @@ const runLines = (wf: any): { job: string; line: string }[] =>
107
107
  ),
108
108
  );
109
109
 
110
+ /** `release.yml`, or a prefixed one such as `manifold-cli-release.yml`. */
111
+ const RELEASE_NAME = /(?:^|-)release\.ya?ml$/;
112
+
113
+ /** Publishes a package or a GitHub release, whatever the workflow is named. */
114
+ const publishes = (wf: any): boolean =>
115
+ Object.values<any>(wf.jobs ?? {}).some((j) =>
116
+ (j.steps ?? []).some(
117
+ (s: any) => typeof s.uses === "string" && s.uses.startsWith("softprops/action-gh-release"),
118
+ ),
119
+ ) ||
120
+ runLines(wf).some(({ line }) =>
121
+ parseScript(line).some(({ argv: [bin, sub, arg] }) =>
122
+ ["npm", "bun", "pnpm", "yarn"].includes(bin!)
123
+ ? sub === "publish"
124
+ : bin === "gh" && sub === "release" && arg === "create",
125
+ ),
126
+ );
127
+
110
128
  export const workflowRules = (repo: Repo): Finding[] => {
111
129
  const out: Finding[] = [];
112
130
  const f = (rule: string, where: string, message: string) => out.push({ rule, where, message });
@@ -259,6 +277,16 @@ export const workflowRules = (repo: Repo): Finding[] => {
259
277
  }
260
278
 
261
279
  const tags = wf.on?.push?.tags;
280
+ if (
281
+ (tags !== undefined || RELEASE_NAME.test(name) || publishes(wf)) &&
282
+ JSON.stringify(wf.on) !== JSON.stringify({ push: { tags: ["v*"] } })
283
+ ) {
284
+ f(
285
+ "workflows/release-trigger",
286
+ where,
287
+ `triggers on \`${JSON.stringify(wf.on)}\`; a release workflow runs on \`push: tags: ["v*"]\` only`,
288
+ );
289
+ }
262
290
  if (tags !== undefined) {
263
291
  out.push(...releaseRules(repo, where, wf));
264
292
  }