mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-23 21:56:43 +02:00
style: auto-format codebase with Prettier
Applied formatting to 1487+ files using pnpm format:write - TypeScript/JavaScript files - Svelte components - Astro pages - JSON configs - Markdown docs 13 files still need manual review (Astro JSX comments)
This commit is contained in:
parent
0241f5554c
commit
d36b321d9d
3952 changed files with 661498 additions and 739751 deletions
|
|
@ -5,49 +5,49 @@ import fs from 'fs-extra';
|
|||
* Get the root directory of the memoro-ui package
|
||||
*/
|
||||
export function getPackageRoot(): string {
|
||||
// CLI is in packages/memoro-ui/cli/
|
||||
// Package root is packages/memoro-ui/
|
||||
return path.resolve(__dirname, '../../../');
|
||||
// CLI is in packages/memoro-ui/cli/
|
||||
// Package root is packages/memoro-ui/
|
||||
return path.resolve(__dirname, '../../../');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the path to the registry.json file
|
||||
*/
|
||||
export function getRegistryPath(): string {
|
||||
return path.join(getPackageRoot(), 'registry.json');
|
||||
return path.join(getPackageRoot(), 'registry.json');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the path to the components directory
|
||||
*/
|
||||
export function getComponentsPath(): string {
|
||||
return path.join(getPackageRoot(), 'components');
|
||||
return path.join(getPackageRoot(), 'components');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the destination path for components in the target app
|
||||
*/
|
||||
export function getDestinationPath(cwd: string = process.cwd()): string {
|
||||
// Check if we're in an app directory with a components folder
|
||||
const possiblePaths = [
|
||||
path.join(cwd, 'components'),
|
||||
path.join(cwd, 'app', 'components'),
|
||||
path.join(cwd, 'src', 'components'),
|
||||
];
|
||||
// Check if we're in an app directory with a components folder
|
||||
const possiblePaths = [
|
||||
path.join(cwd, 'components'),
|
||||
path.join(cwd, 'app', 'components'),
|
||||
path.join(cwd, 'src', 'components'),
|
||||
];
|
||||
|
||||
for (const p of possiblePaths) {
|
||||
if (fs.existsSync(p)) {
|
||||
return p;
|
||||
}
|
||||
}
|
||||
for (const p of possiblePaths) {
|
||||
if (fs.existsSync(p)) {
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to components/ in current directory
|
||||
return path.join(cwd, 'components');
|
||||
// Default to components/ in current directory
|
||||
return path.join(cwd, 'components');
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure a directory exists, create if not
|
||||
*/
|
||||
export async function ensureDir(dirPath: string): Promise<void> {
|
||||
await fs.ensureDir(dirPath);
|
||||
await fs.ensureDir(dirPath);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue