save registry

This commit is contained in:
熊潇 2025-05-23 11:38:33 +08:00
parent 8b2313f817
commit 784aa6380e
2 changed files with 23 additions and 15 deletions

View File

@ -3,25 +3,12 @@
"share": "public" "share": "public"
}, },
"syncDirectory": [ "syncDirectory": [
{
"files": [
"src/components/a/**/*",
"src/lib/**/*",
"src/hooks/**/*"
],
"registry": "https://kevisual.xiongxiao.me/root/ai/code/registry",
"replace": {
"src/": ""
}
},
{ {
"files": [ "files": [
"registry/**/*" "registry/**/*"
], ],
"registry": "https://kevisual.xiongxiao.me/root/ai/code/registry", "registry": "https://kevisual.xiongxiao.me/root/ai/code",
"replace": { "replace": {}
"registry/": "components/b/"
}
} }
] ]
} }

View File

@ -0,0 +1,21 @@
import { customAlphabet } from 'nanoid';
export const letter = 'abcdefghijklmnopqrstuvwxyz';
export const number = '0123456789';
const alphanumeric = `${letter}${number}`;
export const alphanumericWithDash = `${alphanumeric}-`;
export const uuid = customAlphabet(letter);
export const nanoid = customAlphabet(alphanumeric, 10);
export const nanoidWithDash = customAlphabet(alphanumericWithDash, 10);
/**
* id
* @param number
* @returns
*/
export const randomId = (number: number) => {
const _letter = uuid(1);
return `${_letter}${nanoid(number)}`;
};