Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/check-skills.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ name: Check Skills
on:
pull_request:
paths:
- 'skills/**'
- '**/skills/**'
- '_artifacts/**'
- '**/_artifacts/**'
- "skills/**"
- "**/skills/**"
- "_artifacts/**"
- "**/_artifacts/**"
release:
types: [published]
workflow_dispatch: {}
Expand Down
1 change: 1 addition & 0 deletions core/ai-commit-msg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
],
"scripts": {
"build": "tsdown",
"build:snapshot": "tsdown -u",
"dev": "tsdown --watch",
"lint": "eslint ./src/ --pass-on-no-patterns --no-error-on-unmatched-pattern",
"lint:fix": "eslint ./src/ --pass-on-no-patterns --no-error-on-unmatched-pattern --fix"
Expand Down
1 change: 1 addition & 0 deletions core/astro-iconify-svgmap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
],
"scripts": {
"build": "tsdown --profile=node16",
"build:snapshot": "tsdown -u",
"dev": "tsdown --watch",
"lint": "eslint ./",
"lint:fix": "eslint ./ --fix",
Expand Down
3 changes: 2 additions & 1 deletion core/auto-readme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@
"auto-readme": "./dist/cli.mjs"
},
"files": [
"./dist",
"dist",
"skills"
],
"scripts": {
"build": "tsdown",
"postbuild": "publint",
"build:snapshot": "tsdown -u",
"dev": "tsdown --watch",
"lint": "eslint ./src/ --pass-on-no-patterns --no-error-on-unmatched-pattern",
"lint:fix": "eslint ./src/ --pass-on-no-patterns --no-error-on-unmatched-pattern --fix"
Expand Down
3 changes: 2 additions & 1 deletion core/catppuccin-jsonresume-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"template"
],
"scripts": {
"build": "pnpm run --sequential \"/^build:.*/\"",
"build": "pnpm run --sequential \"/^build:(?!snapshot).*/\"",
"build:snapshot": "tsdown -u",
"build:ts": "tsdown",
"build:tw": "tailwindcss -i ./template/site.css -o ./dist-css/site.css",
"dev": "pnpm run --parallel \"/^dev:.*/\"",
Expand Down
1 change: 1 addition & 0 deletions core/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
],
"scripts": {
"build": "tsdown",
"build:snapshot": "tsdown -u",
"dev": "tsdown --watch",
"lint": "eslint ./ --pass-on-no-patterns --no-error-on-unmatched-pattern",
"lint:fix": "eslint ./ --pass-on-no-patterns --no-error-on-unmatched-pattern --fix",
Expand Down
7 changes: 4 additions & 3 deletions core/multipublish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,20 @@
"./cli": "./dist/cli.mjs",
"./package.json": "./package.json",
"./schema": "./dist/schema.mjs",
"./schema.json": "./config/schema.json"
"./schema.json": "./dist/schema.json"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify schema.json and schema.d.cts locations in multipublish package

# Check if schema.json exists in dist after build
fd -t f 'schema.json' core/multipublish/

# Check if schema.d.cts exists in config
fd -t f 'schema.d.cts' core/multipublish/

# Check the build configuration to see where schema files are generated
cat core/multipublish/tsdown.config.ts 2>/dev/null || echo "No tsdown config found"

Repository: stephansama/packages

Length of output: 1126


🏁 Script executed:

cat -n core/multipublish/package.json | sed -n '25,35p'

Repository: stephansama/packages

Length of output: 410


🏁 Script executed:

fd -t f 'schema.d.*' core/multipublish/

Repository: stephansama/packages

Length of output: 46


🏁 Script executed:

grep -r "schema.d.cts" core/multipublish/ --include="*.ts" --include="*.js" --include="*.json"

Repository: stephansama/packages

Length of output: 131


Update the types field to point to the correct location in dist directory.

The types field on line 30 points to ./config/schema.d.cts, but this file does not exist. Since the schema export now points to ./dist/schema.json and the build is configured with dts: true for the schema entry, the type declaration file should be generated in the dist directory. Update the types field to ./dist/schema.d.ts or the appropriate generated file location to ensure the package exports valid type definitions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/multipublish/package.json` at line 28, The package.json currently points
the "types" field at a non-existent path (./config/schema.d.cts); update the
"types" entry to reference the generated declaration inside dist (e.g.,
"./dist/schema.d.ts") so consumers can find the emitted type definitions; edit
the package.json "types" field to "./dist/schema.d.ts" (or the exact generated
file name) to match the schema export ("./dist/schema.json") and the build
setting that emits d.ts files.

},
"types": "./config/schema.d.cts",
"bin": {
"multipublish": "./dist/cli.mjs"
},
"files": [
"./dist",
"./config",
"dist",
"config",
"skills"
],
"scripts": {
"build": "tsdown",
"build:snapshot": "tsdown -u",
"dev": "tsdown --watch",
"lint": "eslint ./src/ --pass-on-no-patterns --no-error-on-unmatched-pattern",
"lint:fix": "eslint ./src/ --pass-on-no-patterns --no-error-on-unmatched-pattern --fix"
Expand Down
1 change: 1 addition & 0 deletions core/typed-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"sideEffects": false,
"type": "module",
"exports": {

Check warning on line 27 in core/typed-events/package.json

View workflow job for this annotation

GitHub Actions / Examples / Test

Entries in 'exports' are not in lexicographical order
".": "./dist/index.mjs",
"./errors": "./dist/errors.mjs",
"./react": "./dist/react.mjs",
Expand All @@ -37,6 +37,7 @@
],
"scripts": {
"build": "tsdown",
"build:snapshot": "tsdown -u",
"dev": "tsdown --watch",
"lint": "eslint ./ --pass-on-no-patterns --no-error-on-unmatched-pattern",
"lint:fix": "eslint ./ --pass-on-no-patterns --no-error-on-unmatched-pattern --fix"
Expand All @@ -56,7 +57,7 @@
"zod": "catalog:schema"
},
"peerDependencies": {
"react": ">=18"

Check warning on line 60 in core/typed-events/package.json

View workflow job for this annotation

GitHub Actions / Examples / Test

Dependency "react" has versions without provenance information: 18.0.0 - 19.0.6
},
"peerDependenciesMeta": {
"react": {
Expand Down
1 change: 1 addition & 0 deletions core/typed-nocodb-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
],
"scripts": {
"build": "tsdown",
"build:snapshot": "tsdown -u",
"dev": "tsdown --watch",
"lint": "eslint ./ --pass-on-no-patterns --no-error-on-unmatched-pattern",
"lint:fix": "eslint ./ --pass-on-no-patterns --no-error-on-unmatched-pattern --fix"
Expand Down
1 change: 1 addition & 0 deletions core/typed-templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
],
"scripts": {
"build": "tsdown",
"build:snapshot": "tsdown -u",
"dev": "tsdown --watch",
"lint": "eslint ./ --pass-on-no-patterns --no-error-on-unmatched-pattern",
"lint:fix": "eslint ./ --pass-on-no-patterns --no-error-on-unmatched-pattern --fix"
Expand All @@ -52,8 +53,8 @@
"zod": "catalog:schema"
},
"peerDependencies": {
"arktype": ">=2",

Check warning on line 56 in core/typed-templates/package.json

View workflow job for this annotation

GitHub Actions / Examples / Test

Dependency "arktype" has versions without provenance information: 2.0.0 - 2.2.0
"handlebars": ">=4",

Check warning on line 57 in core/typed-templates/package.json

View workflow job for this annotation

GitHub Actions / Examples / Test

Dependency "handlebars" has versions without provenance information: 4.0.0 - 4.7.9
"valibot": ">=1",
"zod": ">=4"
},
Expand Down
1 change: 1 addition & 0 deletions core/types-lhci/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"scripts": {
"build": "tsdown",
"postbuild": "publint",
"build:snapshot": "tsdown -u",
"dev": "tsdown --watch",
"lint": "eslint ./ --pass-on-no-patterns --no-error-on-unmatched-pattern",
"lint:fix": "eslint ./ --pass-on-no-patterns --no-error-on-unmatched-pattern --fix"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"svelte-eslint-parser": "catalog:eslint",
"taze": "catalog:"
},
"packageManager": "pnpm@10.29.3",
"packageManager": "pnpm@11.1.2",
"engines": {
"node": ">=24"
}
Expand Down
24 changes: 11 additions & 13 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,6 @@ cleanupUnusedCatalogs: true

engineStrict: true

ignoredBuiltDependencies:
- '@parcel/watcher'
- '@swc/core'
- core-js-pure
- highlight.js
- sharp
- unrs-resolver
- workerd

onlyBuiltDependencies:
- esbuild
- lefthook

overrides:
'@stephansama/astro-iconify-svgmap': workspace:*
'@stephansama/catppuccin-xsl': workspace:*
Expand All @@ -229,3 +216,14 @@ overrides:
create-stephansama-example: workspace:*

shellEmulator: true

allowBuilds:
esbuild: true
lefthook: true
'@parcel/watcher': false
'@swc/core': false
core-js-pure: false
highlight.js: false
sharp: false
unrs-resolver: false
workerd: false
37 changes: 25 additions & 12 deletions scripts/src/prepare-local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,27 @@ import { getPackages } from "@manypkg/get-packages";
import * as cp from "node:child_process";
import * as fs from "node:fs";
import path from "node:path";
import * as url from "node:url";

if (process.env.CI) process.exit(0);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The removal of the process.env.CI check will cause this script to run in CI environments. Since this script triggers builds for workspace packages, it may lead to redundant build steps if your CI pipeline already handles building. It's generally recommended to keep this check to avoid unnecessary overhead in CI.


const sh = String.raw;

const { packages, rootPackage } = await getPackages(process.cwd());

const allRootDependencies = {
...rootPackage?.packageJson.devDependencies,
...rootPackage?.packageJson.dependencies,
};

const stephansamaPackageNames = new Set(
Object.keys(allRootDependencies).filter((dependency) => {
return dependency.startsWith("@stephansama/");
}),
Object.keys({
...rootPackage?.packageJson.devDependencies,
...rootPackage?.packageJson.dependencies,
}).filter((dependency) => dependency.startsWith("@stephansama/")),
);

const stephansamaPackages = packages.filter((pkg) => {
return stephansamaPackageNames.has(pkg.packageJson.name);
});

const packageBins = new Array<string>();

for (const pkg of stephansamaPackages) {
const hasAllOutputs = pkg.packageJson.files.every((file) => {
return fs.existsSync(path.resolve(pkg.dir, file));
Expand All @@ -35,8 +34,22 @@ for (const pkg of stephansamaPackages) {

console.info(`running build for ${pkg.packageJson.name}`);

cp.execSync(sh`pnpm --filter='${pkg.packageJson.name}' run build`, {
encoding: "utf8",
stdio: "inherit",
});
if (pkg.packageJson.bin) {
const { bin } = pkg.packageJson;
const binName = pkg.packageJson.name.replace("@stephansama/", "");
const entries = typeof bin === "string" ? [binName] : Object.keys(bin);
packageBins.push(...entries);
}

const buildPackageCommand = sh`pnpm --filter='${pkg.packageJson.name}' run build`;

cp.execSync(buildPackageCommand, { encoding: "utf8", stdio: "inherit" });
}

const dirname = path.dirname(url.fileURLToPath(import.meta.url));
const nodeBinDirectory = path.resolve(dirname, "../../node_modules/.bin/");
const nodeBins = await fs.promises.readdir(nodeBinDirectory);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The fs.promises.readdir call will throw an error if the node_modules/.bin directory does not exist. It is safer to check for the directory's existence before attempting to read it to prevent the script from crashing.

const nodeBins = fs.existsSync(nodeBinDirectory) ? await fs.promises.readdir(nodeBinDirectory) : [];


if (packageBins.some((bin) => !nodeBins.includes(bin))) {
cp.execSync(sh`pnpm install`, { stdio: "inherit" });
}
Comment on lines +53 to 55
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Executing pnpm install from within a script called by the prepare hook (which is itself triggered by pnpm install) can cause recursive execution. While it might terminate after the second run if no more builds are needed, it significantly increases installation time and can lead to lockfile contention. Consider if this automatic re-install is strictly necessary or if there's a more efficient way to ensure binaries are linked, such as a manual step or a more targeted linking script.

Comment on lines +49 to 55
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add error handling for missing node_modules/.bin directory.

Line 49 calls fs.promises.readdir on node_modules/.bin/ without error handling. If the directory doesn't exist (e.g., on a fresh clone before any install), the script will crash with an unhandled promise rejection.

🛡️ Proposed fix to add error handling
 const dirname = path.dirname(url.fileURLToPath(import.meta.url));
 const nodeBinDirectory = path.resolve(dirname, "../../node_modules/.bin/");
-const nodeBins = await fs.promises.readdir(nodeBinDirectory);
+const nodeBins = fs.existsSync(nodeBinDirectory) 
+  ? await fs.promises.readdir(nodeBinDirectory)
+  : [];
 
 if (packageBins.some((bin) => !nodeBins.includes(bin))) {
   cp.execSync(sh`pnpm install`, { stdio: "inherit" });
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const dirname = path.dirname(url.fileURLToPath(import.meta.url));
const nodeBinDirectory = path.resolve(dirname, "../../node_modules/.bin/");
const nodeBins = await fs.promises.readdir(nodeBinDirectory);
if (packageBins.some((bin) => !nodeBins.includes(bin))) {
cp.execSync(sh`pnpm install`, { stdio: "inherit" });
}
const dirname = path.dirname(url.fileURLToPath(import.meta.url));
const nodeBinDirectory = path.resolve(dirname, "../../node_modules/.bin/");
const nodeBins = fs.existsSync(nodeBinDirectory)
? await fs.promises.readdir(nodeBinDirectory)
: [];
if (packageBins.some((bin) => !nodeBins.includes(bin))) {
cp.execSync(sh`pnpm install`, { stdio: "inherit" });
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/src/prepare-local.ts` around lines 47 - 53, The code calls
fs.promises.readdir(nodeBinDirectory) without handling the case where
node_modules/.bin doesn't exist; wrap that call in a try/catch inside
prepare-local (around the nodeBinDirectory/nodeBins logic) so that on ENOENT (or
other expected filesystem errors) you set nodeBins = [] (or fallback to an empty
array) and optionally log a warning, and only call cp.execSync(sh`pnpm install`,
...) when packageBins.some(bin => !nodeBins.includes(bin)) remains true;
reference the existing symbols nodeBinDirectory, nodeBins, fs.promises.readdir,
packageBins, and cp.execSync when making the change.

1 change: 1 addition & 0 deletions scripts/types/packagejson.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {} from "@manypkg/tools";

declare module "@manypkg/tools" {
export interface PackageJSON {
bin?: Record<string, string> | string;
description?: string;
files: Array<string>;
scripts?: Record<string, string>;
Expand Down
4 changes: 4 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"dependsOn": ["^build"],
"outputs": ["dist*/**", "config", "!.next/cache/**"]
},
"build:snapshot": {
"dependsOn": ["^build:snapshot"],
"outputs": ["__snapshots__"]
},
"build:storybook": {
"dependsOn": ["^build"],
"outputs": ["storybook-static"]
Expand Down
Loading