style(projects): format code

This commit is contained in:
Soybean
2023-12-14 21:45:29 +08:00
parent a176dc443e
commit a748166399
127 changed files with 2472 additions and 3006 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env node
const path = require('path');
const path = require('node:path');
const jiti = require('jiti')(__filename);
jiti(path.resolve(__dirname, './src/index.ts'));

View File

@ -1,19 +1,17 @@
{
"name": "@sa/scripts",
"version": "1.0.0",
"bin": {
"sa": "./bin.cjs"
},
"exports": {
".": "./src/index.ts"
},
"typesVersions": {
"*": {
"*": [
"./src/*"
]
"*": ["./src/*"]
}
},
"bin": {
"sa": "./bin.cjs"
},
"devDependencies": {
"c12": "1.5.1",
"cac": "6.7.14",
@ -21,8 +19,8 @@
"enquirer": "2.4.1",
"execa": "8.0.1",
"jiti": "1.21.0",
"lint-staged": "15.1.0",
"npm-check-updates": "16.14.6",
"lint-staged": "15.2.0",
"npm-check-updates": "16.14.12",
"rimraf": "5.0.5"
}
}

View File

@ -1,7 +1,7 @@
import path from 'node:path';
import { readFileSync } from 'node:fs';
import enquirer from 'enquirer';
import { bgRed, red, green } from 'kolorist';
import { bgRed, green, red } from 'kolorist';
import { execCommand } from '../shared';
import type { CliOption } from '../types';

View File

@ -1,3 +1,4 @@
import process from 'node:process';
import { loadConfig } from 'c12';
import type { CliOption } from '../types';

View File

@ -1,7 +1,7 @@
import cac from 'cac';
import { blue, lightGreen } from 'kolorist';
import { version } from '../package.json';
import { cleanup, updatePkg, gitCommit, gitCommitVerify, prettierWrite, execLintStaged } from './commands';
import { cleanup, execLintStaged, gitCommit, gitCommitVerify, prettierWrite, updatePkg } from './commands';
import { loadCliOptions } from './config';
type Command = 'cleanup' | 'update-pkg' | 'git-commit' | 'git-commit-verify' | 'prettier-write' | 'lint-staged';

View File

@ -1,37 +1,33 @@
export interface CliOption {
/**
* the project root directory
*/
/** The project root directory */
cwd: string;
/**
* cleanup dirs
* Cleanup dirs
*
* Glob pattern syntax {@link https://github.com/isaacs/minimatch}
*
* @default
* ```json
* ["** /dist", "** /pnpm-lock.yaml", "** /node_modules", "!node_modules/**"]
* ```
* @description glob pattern syntax {@link https://github.com/isaacs/minimatch}
*/
cleanupDirs: string[];
/**
* git commit types
*/
/** Git commit types */
gitCommitTypes: [string, string][];
/**
* git commit scopes
*/
/** Git commit scopes */
gitCommitScopes: [string, string][];
/**
* npm-check-updates command args
* @default ["--deep","-u"]
* Npm-check-updates command args
*
* @default ['--deep', '-u']
*/
ncuCommandArgs: string[];
/**
* prettier write glob
* @description glob pattern syntax {@link https://github.com/micromatch/micromatch}
* Prettier write glob
*
* Glob pattern syntax {@link https://github.com/micromatch/micromatch}
*/
prettierWriteGlob: string[];
/**
* lint-staged config
*/
/** Lint-staged config */
lintStagedConfig: Record<string, string | string[]>;
}

View File

@ -1,19 +1,19 @@
{
"compilerOptions": {
"target": "ESNext",
"jsx": "preserve",
"lib": ["DOM", "ESNext"],
"baseUrl": ".",
"module": "ESNext",
"target": "ESNext",
"lib": ["DOM", "ESNext"],
"strict": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"jsx": "preserve",
"moduleResolution": "node",
"resolveJsonModule": true,
"noUnusedLocals": true,
"types": ["node"],
"strict": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"types": ["node"]
"noUnusedLocals": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*", "typings/**/*"],
"exclude": ["node_modules", "dist"]