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
2 changes: 1 addition & 1 deletion .github/actions/node-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ runs:
yarn config set winLinkType symlinks
if [ "${{ inputs.strict }}" = "true" ]; then
yarn install --immutable --check-resolutions --refresh-lockfile
yarn constraints
yarn check:pkgs
else
yarn install
fi
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,24 @@ jobs:
- name: Setup
uses: ./.github/actions/node-setup

- name: More setup cache
uses: ./.github/actions/cache-dir
with:
key: install-and-check
paths: |
.cache
**/.cache
dist
**/dist

- name: Project Reference Check
run: yarn sync:check

- name: Typechecker
run: yarn build:type

- name: Lint & format
run: |
## Workflow lint
yarn lint:action

## Require type build
# https://typescript-eslint.io/getting-started/typed-linting/
yarn lint
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"nodenext",
"nums",
"oldstyle",
"pkgs",
"Pretendard",
"Resizer",
"unicase",
Expand Down
552 changes: 273 additions & 279 deletions .yarn/releases/yarn-4.9.1.cjs → .yarn/releases/yarn-4.9.2.cjs

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ globalFolder: ./.yarn/cache/global

nodeLinker: pnpm

packageExtensions:
"prettier-eslint@*":
dependencies:
"typescript": "*"

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
spec: "https://mskelton.dev/yarn-outdated/v3"

yarnPath: .yarn/releases/yarn-4.9.1.cjs
yarnPath: .yarn/releases/yarn-4.9.2.cjs
18 changes: 9 additions & 9 deletions configs/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
}
},
"devDependencies": {
"@eslint/js": "^9.25.0",
"@typescript-eslint/parser": "^8.30.1",
"eslint-config-prettier": "^10.1.2",
"eslint-plugin-prettier": "^5.2.6",
"eslint-plugin-yml": "^1.17.0",
"globals": "^16.0.0",
"@eslint/js": "^9.28.0",
"@typescript-eslint/parser": "^8.33.1",
"eslint": "^9.28.0",
"eslint-config-prettier": "^10.1.5",
"eslint-plugin-prettier": "^5.4.1",
"eslint-plugin-yml": "^1.18.0",
"globals": "^16.2.0",
"prettier": "^3.5.3",
"prettier-config-custom": "workspace:^",
"typescript": "^5.8.3",
"typescript-eslint": "^8.30.1",
"yaml-eslint-parser": "^1.3.0"
},
"peerDependencies": {
"eslint": "*"
},
"prettier": "prettier-config-custom"
}
2 changes: 2 additions & 0 deletions configs/tsconfig-custom/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"declaration": false,
"emitDeclarationOnly": false,
"noEmit": true,
"allowJs": true,
"checkJs": true,
"paths": {}
}
}
31 changes: 19 additions & 12 deletions configs/vite-config-custom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { PromisePool } from "@supercharge/promise-pool";
import { initConfigBuilder, ViteEnv, PluginBuilder } from "vite-config-builder";
import { mergeConfig } from "vite";

import { ModuleKind } from "typescript";
import { ModuleKind, ModuleResolutionKind } from "typescript";
import { externalizeDeps } from "vite-plugin-externalize-deps";
import tsconfigPaths from "vite-tsconfig-paths";
import dts from "vite-plugin-dts";
import { dts } from "vite-plugin-dts-build";

// == Main Configs ============================================================
export function NodeConfig(viteConfigEnv, extendConfigs = {}) {
Expand All @@ -33,28 +33,35 @@ function NodeBuilder(viteConfigEnv) {
const packageRoot = cwd();
const entryRoot = resolve(packageRoot, "src");
const entryFile = resolve(entryRoot, "index.ts");
const cacheEsmDir = resolve(packageRoot, ".cache", "typescript", "esm");
const cacheCjsDir = resolve(packageRoot, ".cache", "typescript", "cjs");
const outEsmDir = resolve(packageRoot, "dist", "esm");
const outCjsDir = resolve(packageRoot, "dist", "cjs");

const isCI = isGithubCI();
const runtimeEnv = getRuntimeEnv();
if (ViteEnv.isProd()) {
if (!isCI) {
if (runtimeEnv === "LOCAL" || runtimeEnv === "PUBLISH") {
plugins.add(
// This is currently a proprietary implementation. You might also like to see
// https://github.com/qmhc/vite-plugin-dts/issues/267
dts({
entryRoot,
include: ["src"],
cacheDir: cacheEsmDir,
outDir: outEsmDir,
tsconfigPath: resolve(packageRoot, "tsconfig.lib.json")
}),
})
);
}
if (runtimeEnv === "PUBLISH") {
plugins.add(
dts({
entryRoot,
include: ["src"],
cacheDir: cacheCjsDir,
outDir: outCjsDir,
tsconfigPath: resolve(packageRoot, "tsconfig.lib.json"),
compilerOptions: {
module: ModuleKind.CommonJS,
moduleResolution: ModuleResolutionKind.Node10,
outDir: outCjsDir,
declarationDir: outCjsDir,
tsBuildInfoFile: resolve(
Expand Down Expand Up @@ -110,7 +117,7 @@ function NodeBuilder(viteConfigEnv) {
entry: {
index: entryFile
},
formats: isCI ? ["es"] : ["es", "cjs"],
formats: ["es", "cjs"],
fileName: (format, entryName) =>
`${format === "es" ? "esm" : "cjs"}/${entryName}.${format === "es" ? "mjs" : "cjs"}`
},
Expand Down Expand Up @@ -227,13 +234,13 @@ async function processCtsFile(fullPath) {
await unlink(fullPath);
}

function isGithubCI() {
function getRuntimeEnv() {
if (env["PACKAGE_PUBLISH"] === "true") {
return false;
return "PUBLISH";
}

if (env["GITHUB_ACTIONS"] === "true") {
return true;
return "ACTIONS";
}
return false;
return "LOCAL";
}
9 changes: 4 additions & 5 deletions configs/vite-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
"devDependencies": {
"prettier-config-custom": "workspace:^",
"vite-config-builder": "^0.0.2",
"vite-plugin-dts": "^4.5.3",
"vite-plugin-dts-build": "^0.1.3",
"vite-plugin-externalize-deps": "^0.9.0",
"vite-tsconfig-paths": "^5.1.4"
},
"peerDependencies": {
"vite": "*"
},
"dependencies": {
"@supercharge/promise-pool": "^3.2.0"
"@supercharge/promise-pool": "^3.2.0",
"typescript": "^5.8.3",
"vite": "^6.3.5"
}
}
26 changes: 13 additions & 13 deletions examples/react-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
"dev": "vite",
"build": "vite build",
"build:type-check": "tsc -b && vite build",
"lint": "eslint .",
"lint": "eslint . --cache --cache-location .cache/eslint --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@babel/core": "^7.26.10",
"@babel/preset-typescript": "^7.27.0",
"@babel/preset-typescript": "^7.27.1",
"@emotion/hash": "^0.9.2",
"@mincho-js/css": "workspace:^",
"@mincho-js/integration": "workspace:^",
"@mincho-js/react": "workspace:^",
"@mincho-js/vite": "workspace:^",
"@vanilla-extract/css": "^1.17.1",
"@vanilla-extract/css": "^1.17.2",
"@vanilla-extract/css-utils": "^0.1.4",
"@vanilla-extract/private": "^1.0.6",
"@vanilla-extract/private": "^1.0.7",
"css-what": "^6.1.0",
"cssesc": "^3.0.0",
"dedent": "^1.5.3",
"dedent": "^1.6.0",
"deep-object-diff": "^1.1.9",
"deepmerge": "^4.3.1",
"lru-cache": "^11.1.0",
Expand All @@ -35,19 +35,19 @@
"scheduler": "^0.26.0"
},
"devDependencies": {
"@eslint/js": "^9.25.0",
"@eslint/js": "^9.28.0",
"@types/babel__core": "^7.20.5",
"@types/cssesc": "^3.0.2",
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@types/react": "^19.1.6",
"@types/react-dom": "^19.1.6",
"@types/scheduler": "^0.26.0",
"@vitejs/plugin-react": "^4.4.1",
"eslint": "^9.25.0",
"@vitejs/plugin-react": "^4.5.1",
"eslint": "^9.28.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.19",
"globals": "^16.0.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.2.0",
"typescript": "~5.8.3",
"typescript-eslint": "^8.30.1",
"vite": "^6.3.2"
"vite": "^6.3.5"
}
}
28 changes: 14 additions & 14 deletions examples/react-swc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@
"start": "vite",
"build": "vite build",
"check": "tsc",
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
"lint": "eslint . --cache --cache-location .cache/eslint --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@eslint/js": "^9.25.0",
"@eslint/js": "^9.28.0",
"@mincho-js/css": "workspace:^",
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@typescript-eslint/eslint-plugin": "^8.30.1",
"@typescript-eslint/parser": "^8.30.1",
"@vanilla-extract/css": "^1.17.1",
"@vanilla-extract/esbuild-plugin": "^2.3.15",
"@vanilla-extract/vite-plugin": "^5.0.1",
"@vitejs/plugin-react-swc": "^3.9.0",
"eslint": "^9.25.0",
"@types/react": "^19.1.6",
"@types/react-dom": "^19.1.6",
"@typescript-eslint/eslint-plugin": "^8.33.1",
"@typescript-eslint/parser": "^8.33.1",
"@vanilla-extract/css": "^1.17.2",
"@vanilla-extract/esbuild-plugin": "^2.3.16",
"@vanilla-extract/vite-plugin": "^5.0.3",
"@vitejs/plugin-react-swc": "^3.10.1",
"eslint": "^9.28.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.19",
"globals": "^16.0.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.2.0",
"typescript": "^5.8.3",
"typescript-eslint": "^8.30.1",
"vite": "^6.3.2"
"vite": "^6.3.5"
}
}
32 changes: 17 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mincho",
"type": "module",
"private": true,
"packageManager": "yarn@4.9.1",
"packageManager": "yarn@4.9.2",
"workspaces": [
"configs/*",
"packages/*",
Expand All @@ -13,13 +13,15 @@
"clean": "yarn g:clean && yarn task clean",
"build": "yarn task build",
"build:type": "yarn tsc --build",
"lint": "yarn task lint",
"lint": "yarn lint:action & yarn task lint",
"lint:action": "yarn run -T eslint '.github/**/*.{js,yaml,yml}' --cache --cache-location .cache/eslint_action",
"fix": "yarn fix:action && yarn task fix",
"fix:action": "yarn lint:action --fix",
"check": "yarn task check",
"check:all": "yarn task check:all",
"sync": "workspaces-to-typescript-project-references --includesRoot",
"check:peers": "yarn explain peer-requirements | grep -q '✘' && exit 1 || exit 0",
"check:pkgs": "yarn check:peers & yarn constraints",
Comment on lines +22 to +23
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify the reliability of the peer dependency check.

The check:peers script uses grep with exit codes to validate peer dependencies. Ensure this approach reliably detects all peer dependency issues across different environments.


🏁 Script executed:

#!/bin/bash
# Description: Test the check:peers script behavior to ensure it works reliably
# Expected: The script should exit with code 1 when peer dependency issues exist, 0 otherwise

# Check if the yarn explain peer-requirements command exists and what output format it produces
yarn explain peer-requirements --help || echo "Command not available"

# Test the actual command to see its output format
yarn explain peer-requirements | head -20

Length of output: 4315


Improve the peer-dependency check for reliability

The current script in package.json (lines 22–23):

- "check:peers": "yarn explain peer-requirements | grep -q '✘' && exit 1 || exit 0",
+ "check:peers": "yarn explain peer-requirements 2>/dev/null | grep -q '✘' && exit 1 || exit 0",

Issues uncovered:

  • Grep’s early exit can trigger EPIPE errors in Yarn.
  • Unicode “✘” may be replaced by a fallback “X” or localized symbol.
  • Colored/ANSI-wrapped output may prevent a literal match.

Recommendations:

  • Redirect stderr to suppress broken-pipe noise (2>/dev/null).

  • Lock the script to a consistent Yarn version + locale in CI.

  • If your Yarn version supports JSON, consider parsing its output instead:

    - "check:peers": "yarn explain peer-requirements | grep -q '✘' && exit 1 || exit 0",
    + "check:peers": "yarn explain peer-requirements --json \
        | jq -r '.[] | select(.satisfied == false)' \
        && exit 1 || exit 0"

Please update the script in package.json (lines 22–23) to one of these variants and verify that CI fails when any peer is unsatisfied.

📝 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
"check:peers": "yarn explain peer-requirements | grep -q '✘' && exit 1 || exit 0",
"check:pkgs": "yarn check:peers & yarn constraints",
// package.json (scripts section)
"check:peers": "yarn explain peer-requirements 2>/dev/null | grep -q '✘' && exit 1 || exit 0",
"check:pkgs": "yarn check:peers & yarn constraints",
🤖 Prompt for AI Agents
In package.json around lines 22 to 23, the current "check:peers" script uses
grep with a Unicode character to detect peer dependency issues, which can cause
unreliable detection due to EPIPE errors, locale differences, and colored
output. To fix this, modify the script to redirect stderr to /dev/null to
suppress broken-pipe errors, ensure the environment uses a consistent Yarn
version and locale, and if possible, switch to parsing JSON output from "yarn
explain peer-requirements" for more reliable detection. Update the script
accordingly and verify that the CI fails when peer dependencies are unsatisfied.

"sync": "workspaces-to-typescript-project-references --includesRoot --includesLocal",
"sync:check": "yarn sync --check",
"test": "yarn task test",
"test:all": "yarn task test:all",
Expand All @@ -44,29 +46,29 @@
"prettier": "prettier-config-custom",
"devDependencies": {
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.2",
"@changesets/cli": "^2.29.4",
"@mincho-js/debug-log": "workspace:^",
"@monorepo-utils/workspaces-to-typescript-project-references": "^2.10.4",
"@monorepo-utils/workspaces-to-typescript-project-references": "^2.11.0",
"@types/eslint": "^9.6.1",
"@types/node": "^22.14.1",
"@types/node": "^22.15.29",
"@typescript/analyze-trace": "^0.10.1",
"@vanilla-extract/vite-plugin": "^5.0.1",
"@vitest/coverage-v8": "^3.1.1",
"@vanilla-extract/vite-plugin": "^5.0.3",
"@vitest/coverage-v8": "^3.2.2",
"@yarnpkg/types": "^4.0.1",
"c8": "^10.1.3",
"eslint": "^9.25.0",
"eslint": "^9.28.0",
"eslint-config-custom": "workspace:^",
"prettier": "^3.5.3",
"prettier-config-custom": "workspace:^",
"prettier-eslint": "^16.4.1",
"prettier-eslint": "^16.4.2",
"rimraf": "6.0.0",
"terser": "^5.39.0",
"terser": "^5.41.0",
"tsconfig-custom": "workspace:^",
"turbo": "^2.5.0",
"turbo": "^2.5.4",
"typescript": "^5.8.3",
"vite": "^6.3.2",
"vite-node": "^3.1.1",
"vitest": "^3.1.1",
"vite": "^6.3.5",
"vite-node": "^3.2.2",
"vitest": "^3.2.2",
"yarn-constraints-rules": "^0.1.0"
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
"prettier": "prettier-config-custom",
"dependencies": {
"@babel/core": "^7.26.10",
"@babel/helper-module-imports": "^7.25.9",
"@babel/preset-typescript": "^7.27.0",
"@babel/traverse": "^7.27.0",
"@babel/helper-module-imports": "^7.27.1",
"@babel/preset-typescript": "^7.27.1",
"@babel/traverse": "^7.27.4",
"@emotion/hash": "^0.9.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@mincho-js/transform-to-vanilla": "workspace:^"
},
"devDependencies": {
"@vanilla-extract/css": "^1.17.1",
"@vanilla-extract/css": "^1.17.2",
"eslint-config-custom": "workspace:^",
"prettier-config-custom": "workspace:^",
"tsconfig-custom": "workspace:^",
Expand Down
Loading