ui integration and rest api includes
This commit is contained in:
21
combine_topics.cjs
Normal file
21
combine_topics.cjs
Normal file
@@ -0,0 +1,21 @@
|
||||
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');
|
||||
})();
|
||||
Reference in New Issue
Block a user