mirror of
https://github.com/teableio/teable.git
synced 2026-02-19 17:19:50 +08:00
* chore: update tracing details * feat: add attachemnt ro * feat: upgrade to zod 4 and ai-sdk 5 * chore: openapi -> meta * feat: ai-sdk 6 * chore: standard resource type * feat: grid view state subscriber * feat: pick upgrade node to 22 * fix: remove swagger to makesure backend start * fix: remove swagger to makesure backend start * chore: fix typecheck * chore: clean ui effect * chore: i18n for tools * fix: card ui * chore: update ai sdk provider * fix: should not delete the last view in table * feat: better zod error * chore: clean base card * fix: restore into base logic * chore: i18n for tools * chore: i18n for tools * fix: swagger is back * fix: pnpm lock * fix: unit test * fix: remove token * fix: typecheck * feat: proxy setting * chore: update i18n for chat * chore: tools i18n * chore: upgrade ai sdk * chore: i18n for ai gateway * chore: rename app generation to app builder * chore: remove deprecated version * feat: adjust feature limitations * chore: tools i18n * fix: lint issue * fix: api tag * chore: zod i18n * chore: add credit limit exceeded error handling --------- Co-authored-by: SkyHuang <sky.huang.fe@gmail.com>
51 lines
1.3 KiB
JavaScript
51 lines
1.3 KiB
JavaScript
import { execSync } from 'child_process';
|
|
import { readFileSync, writeFileSync, readdirSync, lstatSync } from 'fs';
|
|
import { join } from 'path';
|
|
import data from '../components.json' assert { type: 'json' };
|
|
|
|
const { aliases } = data;
|
|
|
|
function fixAliases(componentName) {
|
|
const fixFile = (filePath) => {
|
|
let content = readFileSync(filePath, 'utf-8');
|
|
|
|
// Replace utils path
|
|
const replaceUtilsPath = join('../utils');
|
|
content = content.replaceAll(aliases.utils, replaceUtilsPath);
|
|
|
|
// Replace components path
|
|
content = content.replaceAll(`${aliases.components}/ui/`, './');
|
|
|
|
writeFileSync(filePath, content, 'utf-8');
|
|
|
|
execSync(`pnpm eslint ${filePath} --fix`, { stdio: 'inherit' });
|
|
|
|
console.log('Fixed.');
|
|
};
|
|
|
|
const folderPath = join(process.cwd(), aliases.components, 'ui');
|
|
|
|
if (componentName) {
|
|
const filePath = join(folderPath, `${componentName}.tsx`);
|
|
fixFile(filePath);
|
|
return;
|
|
}
|
|
|
|
readdirSync(folderPath).forEach((file) => {
|
|
const filePath = join(folderPath, file);
|
|
|
|
if (lstatSync(filePath).isDirectory()) {
|
|
return;
|
|
}
|
|
fixFile(filePath);
|
|
});
|
|
}
|
|
|
|
const args = process.argv.slice(2).join(' ');
|
|
|
|
execSync(`pnpm dlx shadcn@latest add ${args}`, { stdio: 'inherit', cwd: process.cwd() });
|
|
|
|
if (process.argv[2] === 'add') {
|
|
fixAliases(process.argv[3]);
|
|
}
|