22 lines
857 B
JavaScript
22 lines
857 B
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
const { existingTopics } = require('./original_topics.cjs');
|
|
|
|
// Read current topics.js which has the new REST endpoints.
|
|
// We'll just import it using dynamic import since it's an ES module.
|
|
(async () => {
|
|
const topicsModule = await import('file:///' + path.join(__dirname, 'src/data/topics.js').replace(/\\/g, '/'));
|
|
const restTopics = topicsModule.topics;
|
|
|
|
const out = `export const LEGACY_BASE_URL = 'https://api.workolik.com';
|
|
export const REST_BASE_URL = 'https://fiesta.nearle.app';
|
|
|
|
export const legacyTopics = ${JSON.stringify(existingTopics, null, 2)};
|
|
|
|
export const restTopics = ${JSON.stringify(restTopics, null, 2)};
|
|
`;
|
|
|
|
fs.writeFileSync(path.join(__dirname, 'src/data/topics.js'), out, 'utf8');
|
|
console.log('Successfully combined legacy and rest topics into topics.js');
|
|
})();
|