feat: monorepo
This commit is contained in:
9
packages/utils/eslint.config.js
Normal file
9
packages/utils/eslint.config.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import baseConfig from "@kan/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [
|
||||
{
|
||||
ignores: [],
|
||||
},
|
||||
...baseConfig,
|
||||
];
|
||||
30
packages/utils/package.json
Normal file
30
packages/utils/package.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "@kan/utils",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"clean": "git clean -xdf .cache .turbo dist node_modules",
|
||||
"dev": "tsc",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"lint": "eslint",
|
||||
"typecheck": "tsc --noEmit --emitDeclarationOnly false"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kan/eslint-config": "workspace:*",
|
||||
"@kan/prettier-config": "workspace:*",
|
||||
"@kan/tsconfig": "workspace:*",
|
||||
"eslint": "catalog:",
|
||||
"prettier": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
},
|
||||
"prettier": "@kan/prettier-config",
|
||||
"dependencies": {
|
||||
"nanoid": "^5.0.9"
|
||||
}
|
||||
}
|
||||
10
packages/utils/src/generateUID.ts
Normal file
10
packages/utils/src/generateUID.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { customAlphabet } from "nanoid";
|
||||
|
||||
const alphabet = "0123456789abcdefghijklmnopqrstuvwxyz";
|
||||
const length = 12;
|
||||
|
||||
const nanoid = customAlphabet(alphabet, length);
|
||||
|
||||
export function generateUID() {
|
||||
return nanoid();
|
||||
}
|
||||
3
packages/utils/src/index.ts
Normal file
3
packages/utils/src/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export const name = "utils";
|
||||
|
||||
export { generateUID } from "./generateUID";
|
||||
6
packages/utils/tsconfig.json
Normal file
6
packages/utils/tsconfig.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "@kan/tsconfig/internal-package.json",
|
||||
"compilerOptions": {},
|
||||
"include": ["*.ts", "src"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user