General-purpose development tools for TypeScript/JavaScript projects - character validation, circular import detection, and more.
pnpm add -D apdev-js
# or
npm install --save-dev apdev-jsValidate files contain only allowed characters (ASCII + emoji + technical symbols).
npx apdev check-chars src/**/*.tsDetect circular imports in a JS/TS package.
npx apdev check-imports --package mylib --src-dir srcInteractive release automation (build, tag, GitHub release, npm publish).
npx apdev release
npx apdev release 1.0.0Add an "apdev" field to your package.json:
{
"apdev": {
"base_package": "mylib",
"src_dir": "src"
}
}With configuration, you can run check-imports without flags:
npx apdev check-importsAdd character checking as a pre-commit hook:
{
"lint-staged": {
"*.{ts,tsx,js,jsx}": ["apdev check-chars"]
}
}import {
isAllowedChar,
checkFile,
checkPaths,
checkCircularImports,
loadConfig,
} from "apdev-js";
// Check a single character
isAllowedChar("A"); // true
isAllowedChar("\u4E2D"); // false (CJK)
// Check a file
const problems = checkFile("src/index.ts");
// Detect circular imports
const exitCode = checkCircularImports("src", "mylib");Prerequisites: Node.js >= 18, pnpm.
cd typescript
pnpm install # Install dependencies
pnpm build # Build (ESM + CJS + types)
pnpm test # Run tests
pnpm lint # Lint
pnpm format # FormatRequires npm authentication (~/.npmrc) and GitHub CLI (gh).
./release.sh # Use version from package.json
./release.sh 0.2.0 # Specify version
./release.sh --yes # Silent mode (CI/CD)The script will: verify version → clean → build → pack check → git tag → GitHub release → npm publish.
Apache-2.0