mirror of
https://github.com/grafana/grafana.git
synced 2026-03-13 15:29:48 +08:00
* fix(grafana-data): copy theme schema json to types so declaration resolves * refactor(grafana-data): move node scripts out of source code * feat(grafana-data): generate types for theme schema * chore(codeowners): update for grafana-data/scripts file move * feat(grafana-data): put back copy plugin for theme json files * revert(grafana-data): remove definition output * feat(grafana-data): make builds great again * minor tidy up --------- Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
23 lines
552 B
TypeScript
23 lines
552 B
TypeScript
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
import { NewThemeOptionsSchema } from '../src/themes/createTheme';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
const jsonOut = path.join(__dirname, '..', 'src', 'themes', 'schema.generated.json');
|
|
|
|
fs.writeFileSync(
|
|
jsonOut,
|
|
JSON.stringify(
|
|
NewThemeOptionsSchema.toJSONSchema({
|
|
target: 'draft-07',
|
|
}),
|
|
undefined,
|
|
2
|
|
)
|
|
);
|
|
|
|
console.log('Successfully generated theme schema');
|