diff --git a/.github/workflows/check-skills.yml b/.github/workflows/check-skills.yml index 228f5829..5ce0ee37 100644 --- a/.github/workflows/check-skills.yml +++ b/.github/workflows/check-skills.yml @@ -17,10 +17,10 @@ name: Check Skills on: pull_request: paths: - - 'skills/**' - - '**/skills/**' - - '_artifacts/**' - - '**/_artifacts/**' + - "skills/**" + - "**/skills/**" + - "_artifacts/**" + - "**/_artifacts/**" release: types: [published] workflow_dispatch: {} diff --git a/core/ai-commit-msg/package.json b/core/ai-commit-msg/package.json index 286ace45..ad61a6ff 100644 --- a/core/ai-commit-msg/package.json +++ b/core/ai-commit-msg/package.json @@ -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" diff --git a/core/astro-iconify-svgmap/package.json b/core/astro-iconify-svgmap/package.json index 69eeb704..2fe219ac 100644 --- a/core/astro-iconify-svgmap/package.json +++ b/core/astro-iconify-svgmap/package.json @@ -42,6 +42,7 @@ ], "scripts": { "build": "tsdown --profile=node16", + "build:snapshot": "tsdown -u", "dev": "tsdown --watch", "lint": "eslint ./", "lint:fix": "eslint ./ --fix", diff --git a/core/auto-readme/package.json b/core/auto-readme/package.json index 854e7b64..2ce222a1 100644 --- a/core/auto-readme/package.json +++ b/core/auto-readme/package.json @@ -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" diff --git a/core/catppuccin-jsonresume-theme/package.json b/core/catppuccin-jsonresume-theme/package.json index 22a7d74e..8115024e 100644 --- a/core/catppuccin-jsonresume-theme/package.json +++ b/core/catppuccin-jsonresume-theme/package.json @@ -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:.*/\"", diff --git a/core/eslint-config/package.json b/core/eslint-config/package.json index 913fd772..d818ff2e 100644 --- a/core/eslint-config/package.json +++ b/core/eslint-config/package.json @@ -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", diff --git a/core/multipublish/package.json b/core/multipublish/package.json index 22fc7c88..52d762cf 100644 --- a/core/multipublish/package.json +++ b/core/multipublish/package.json @@ -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" }, "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" diff --git a/core/typed-events/package.json b/core/typed-events/package.json index 9dbb8861..66f9e008 100644 --- a/core/typed-events/package.json +++ b/core/typed-events/package.json @@ -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" diff --git a/core/typed-nocodb-api/package.json b/core/typed-nocodb-api/package.json index 5b819e9f..488198c6 100644 --- a/core/typed-nocodb-api/package.json +++ b/core/typed-nocodb-api/package.json @@ -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" diff --git a/core/typed-templates/package.json b/core/typed-templates/package.json index f51e4684..4aa1ef4d 100644 --- a/core/typed-templates/package.json +++ b/core/typed-templates/package.json @@ -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" diff --git a/core/types-lhci/package.json b/core/types-lhci/package.json index 2618df89..c18e6c19 100644 --- a/core/types-lhci/package.json +++ b/core/types-lhci/package.json @@ -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" diff --git a/package.json b/package.json index 043549e1..1143934a 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "svelte-eslint-parser": "catalog:eslint", "taze": "catalog:" }, - "packageManager": "pnpm@10.29.3", + "packageManager": "pnpm@11.1.2", "engines": { "node": ">=24" } diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index d2540187..bda325d1 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -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:* @@ -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 diff --git a/scripts/src/prepare-local.ts b/scripts/src/prepare-local.ts index 796f0229..93b18a3e 100644 --- a/scripts/src/prepare-local.ts +++ b/scripts/src/prepare-local.ts @@ -4,6 +4,7 @@ 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); @@ -11,21 +12,19 @@ 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(); + for (const pkg of stephansamaPackages) { const hasAllOutputs = pkg.packageJson.files.every((file) => { return fs.existsSync(path.resolve(pkg.dir, file)); @@ -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); + +if (packageBins.some((bin) => !nodeBins.includes(bin))) { + cp.execSync(sh`pnpm install`, { stdio: "inherit" }); } diff --git a/scripts/types/packagejson.d.ts b/scripts/types/packagejson.d.ts index ed53b562..cc7f49a9 100644 --- a/scripts/types/packagejson.d.ts +++ b/scripts/types/packagejson.d.ts @@ -2,6 +2,7 @@ import type {} from "@manypkg/tools"; declare module "@manypkg/tools" { export interface PackageJSON { + bin?: Record | string; description?: string; files: Array; scripts?: Record; diff --git a/turbo.json b/turbo.json index f8ba7759..4c42eed7 100644 --- a/turbo.json +++ b/turbo.json @@ -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"]