Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
5e57996
created npm folder and modularized scripts
sagarkori143 Jun 17, 2025
6ed3594
resolved prod fail issues
sagarkori143 Jun 17, 2025
5f27ad2
resolved prod fail issues
sagarkori143 Jun 17, 2025
2f4f22f
resolved prod fail issues
sagarkori143 Jun 17, 2025
2d499cc
moved the logger to utils
sagarkori143 Jun 18, 2025
388dfda
moved the logger to utils
sagarkori143 Jun 18, 2025
b382cf6
solving logger imports after refactoring
sagarkori143 Jun 18, 2025
075cead
refactored the index.ts file for parallel execution of the scripts
sagarkori143 Jun 18, 2025
728ad2b
Merge branch 'master' into modules
asyncapi-bot Jun 18, 2025
9ab9cc3
added more modualarized scripts and runners
sagarkori143 Jun 18, 2025
91e952f
Merge branch 'modules' of github.com:sagarkori143/website into modules
sagarkori143 Jun 18, 2025
1402f9b
removed extra changes
sagarkori143 Jun 18, 2025
b40ab1e
removed extra changes
sagarkori143 Jun 18, 2025
5a83f3f
improved error handling
sagarkori143 Jun 18, 2025
e10c132
made sure to float the errors to the top level and all files are now …
sagarkori143 Jun 19, 2025
dc99fc0
all the scripts are modularized now and are perfectly working
sagarkori143 Jun 19, 2025
9d0fc09
minor changes
sagarkori143 Jun 19, 2025
241396c
added setup for integration testing and added a few tests for the bui…
sagarkori143 Jun 19, 2025
7f34ffa
Merge branch 'master' into modules
sagarkori143 Jun 20, 2025
b4c0184
resolving coderabbit reviews on integration tests file
sagarkori143 Jun 20, 2025
48c9b20
Merge branch 'master' into modules
sagarkori143 Jun 21, 2025
cf0fddd
enhanced error handling of build newsroom videos script to test with …
sagarkori143 Jun 21, 2025
e1b44fc
Merge branch 'master' into modules
sagarkori143 Jun 22, 2025
e239484
removed the scripts copied in the npm directory and shifted the Int t…
sagarkori143 Jun 22, 2025
db991db
updated conflicting path
sagarkori143 Jun 22, 2025
0a79ab8
trying to maintain pages as it is and check if build makes up
sagarkori143 Jun 22, 2025
4db1a6f
reconfigured the build pages page
sagarkori143 Jun 22, 2025
77baacd
reconfigured the build pages page
sagarkori143 Jun 22, 2025
6c2c115
reconfigured the build pages page
sagarkori143 Jun 22, 2025
6d9872f
started building pages with runners
sagarkori143 Jun 22, 2025
3789564
changes suggested by coderabbitAi
sagarkori143 Jun 22, 2025
0145bda
reverted the pages changes
sagarkori143 Jun 22, 2025
cff3857
reverting the pages script changes to check if everything goes right
sagarkori143 Jun 22, 2025
7bfd418
updated build post list according to coderabbit suggestions
sagarkori143 Jun 23, 2025
f025abc
retrying the build pages script runners from cli
sagarkori143 Jun 23, 2025
d06e25a
did some changes to case study card
sagarkori143 Jun 23, 2025
47eeb0b
reverted the case studies changes
sagarkori143 Jun 23, 2025
a8335dc
reverted the case studies changes
sagarkori143 Jun 23, 2025
ce9fc7c
posts reverted
sagarkori143 Jun 23, 2025
96cec2a
separated the unit and integration tests running
sagarkori143 Jun 23, 2025
c48f1fd
added more context to the error in blog compose
sagarkori143 Jun 23, 2025
f7d9a43
Merge branch 'master' into modules
asyncapi-bot Jun 23, 2025
f1192e5
tests fixed
sagarkori143 Jun 23, 2025
b206429
Merge branch 'modules' of github.com:sagarkori143/website into modules
sagarkori143 Jun 23, 2025
98486af
reverted: tests fixed
sagarkori143 Jun 23, 2025
85add6f
minor changes
sagarkori143 Jun 23, 2025
800f03d
Merge branch 'master' into modules
sagarkori143 Jun 27, 2025
f1b3dc6
made a temp change
sagarkori143 Jun 27, 2025
8d2bf22
reverted: made a temp change
sagarkori143 Jun 27, 2025
60cf2f9
Merge branch 'master' into modules
sagarkori143 Jun 28, 2025
2b13160
tried enhancing the error handling and logging
sagarkori143 Jun 28, 2025
e8c2279
fixed the failing tests
sagarkori143 Jun 29, 2025
79da91f
reverted integration test change
sagarkori143 Jun 29, 2025
8767b93
Merge branch 'master' into modules
asyncapi-bot Jun 29, 2025
0b20bf4
solving the failing tests and changed the integration tests logic to …
sagarkori143 Jun 29, 2025
cb4a589
Merge branch 'modules' of github.com:sagarkori143/website into modules
sagarkori143 Jun 29, 2025
ce2a5b7
fixed linting errors
sagarkori143 Jun 29, 2025
27cf32b
improved code coverage
sagarkori143 Jun 29, 2025
592dd9a
Merge branch 'master' into modules
sagarkori143 Jun 30, 2025
f836a26
Merge branch 'master' into modules
sagarkori143 Jul 5, 2025
8ee27a7
shifted the integration tests out of main tests into a temp folder
sagarkori143 Jul 6, 2025
9e68f76
removed index.ts file and removed the linting errors of build dashboa…
sagarkori143 Jul 9, 2025
833008f
Merge branch 'master' into modules
sagarkori143 Jul 9, 2025
8b501e2
did npm binding of dashboard and case studies runner and improved err…
sagarkori143 Jul 10, 2025
1669b3c
reverted the build-pages script in the package.json
sagarkori143 Jul 10, 2025
82442c4
building pages with the runners
sagarkori143 Jul 10, 2025
a1e8b82
binding of build pages and error handling done
sagarkori143 Jul 10, 2025
a65c553
done binding build post list
sagarkori143 Jul 10, 2025
d8f51e0
binding of adopters list module
sagarkori143 Jul 10, 2025
75599a7
binding done of finance info list builders
sagarkori143 Jul 10, 2025
7109472
binding done of meetings.json
sagarkori143 Jul 10, 2025
8363ce3
done binding newsroom
sagarkori143 Jul 10, 2025
d0ad117
binding tools and error handling improved
sagarkori143 Jul 10, 2025
5fea48b
major changes: Refactored all runners, bind them to cli and improved …
sagarkori143 Jul 10, 2025
0176ece
rethrew error after logging for surfacing the errror
sagarkori143 Jul 10, 2025
1f39b40
removed test file
sagarkori143 Jul 12, 2025
c5c0b61
added error classes
akshatnema Jul 13, 2025
b043ffd
refactor scripts files
akshatnema Aug 3, 2025
f688215
Merge branch 'master' into modules
akshatnema Aug 3, 2025
dd9d6e6
empty commit to trigger codecov
akshatnema Aug 3, 2025
11502cc
empty commit to trigger codecov
akshatnema Aug 4, 2025
748c003
added tests to cover 100% test coverage
akshatnema Aug 4, 2025
34637bd
added tests to cover 100% test coverage
akshatnema Aug 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions npm/index.ts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this index.ts script? All scripts will never be executed at same time.

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { runBuildPostList } from './runners/build-post-list-runner';
import { runBuildDashboard } from './runners/build-dashboard-runner';
import { runBuildTools } from './runners/build-tools-runner';
import { runCaseStudies } from './runners/case-studies-runner';
import { runBuildNewsroomVideos } from './runners/build-newsroom-videos-runner';
import { logger } from '../scripts/helpers/logger';
async function main() {

let errorFaced: Boolean = false;
try {

try {
await runBuildPostList();
} catch (err) {
errorFaced = true;
logger.error('Error building posts: ', err as Error);
}

try {
await runBuildDashboard();
} catch (err) {
errorFaced = true;
logger.error('Error building dashboard: ', err as Error);
}

try {
await runBuildTools();
} catch (err) {
errorFaced = true;
logger.error('Error building tools: ', err as Error);
}

try {
await runCaseStudies();
} catch (err) {
errorFaced = true;
logger.error('Error building cases studies: ', err as Error);
}

try {
await runBuildNewsroomVideos();
} catch (err) {
errorFaced = true;
logger.error('Error building newsroom videos: ', err as Error);
}

if (errorFaced) {
console.log("Some scripts faced error while running please check the console for more details")
}
else {
console.log('Successfully executed all build scripts');
}
} catch (error) {
console.error('Error executing build scripts:', error);
throw new Error('Error executing build scripts: ', error as Error);
}
}

main();
17 changes: 17 additions & 0 deletions npm/runners/build-dashboard-runner.ts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains improper eslint formatting with tab width 4. Fix eslint errors in the file.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { start } from "../scripts/dashboard/build-dashboard";

import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';


const currentFilePath = fileURLToPath(import.meta.url);
const currentDirPath = dirname(currentFilePath);

export async function runBuildDashboard() {
try {
await start(resolve(currentDirPath, '..', '..', 'dashboard.json'));
}
catch (error) {
throw new Error('Error building dashboard: ', error as Error);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Incorrect Error constructor usage

new Error(message, error) is not valid; the second argument is ignored unless you pass an options object ({ cause }). Use:

-        throw new Error('Error building dashboard: ', error as Error);
+        throw new Error('Error building dashboard', { cause: error as Error });

Same issue exists in the called start function—worth a quick sweep.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
catch (error) {
throw new Error('Error building dashboard: ', error as Error);
}
catch (error) {
throw new Error('Error building dashboard', { cause: error as Error });
}
🤖 Prompt for AI Agents
In npm/runners/build-dashboard-runner.ts around lines 14 to 16, the Error
constructor is incorrectly used with two arguments, where the second argument is
ignored. Fix this by passing the original error as the cause in an options
object, like new Error('Error building dashboard', { cause: error }). Also,
review the start function for similar incorrect Error constructor usage and
apply the same fix.

}
17 changes: 17 additions & 0 deletions npm/runners/build-newsroom-videos-runner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { buildNewsroomVideos } from "../scripts/build-newsroom-videos";
import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';



const currentFilePath = fileURLToPath(import.meta.url);
const currentDirPath = dirname(currentFilePath);

export async function runBuildNewsroomVideos() {
try {
await buildNewsroomVideos(resolve(currentDirPath, '../../config', 'newsroom_videos.json'));
}
catch (error) {
throw new Error('Error building dashboard: ', error as Error);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Wrong root resolution & misleading error text

  1. resolve(currentDirPath, '../../config' …) points to npm/config, not the repo root.
  2. The thrown message says “dashboard” instead of “newsroom videos”.
-await buildNewsroomVideos(resolve(currentDirPath, '../../config', 'newsroom_videos.json'));
+const projectRoot = resolve(currentDirPath, '../../..');
+await buildNewsroomVideos(resolve(projectRoot, 'config', 'newsroom_videos.json'));-throw new Error('Error building dashboard: ', error as Error);
+throw new Error(`Error building newsroom videos: ${(error as Error).message}`, { cause: error });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export async function runBuildNewsroomVideos() {
try {
await buildNewsroomVideos(resolve(currentDirPath, '../../config', 'newsroom_videos.json'));
}
catch (error) {
throw new Error('Error building dashboard: ', error as Error);
export async function runBuildNewsroomVideos() {
try {
const projectRoot = resolve(currentDirPath, '../../..');
await buildNewsroomVideos(resolve(projectRoot, 'config', 'newsroom_videos.json'));
}
catch (error) {
throw new Error(
`Error building newsroom videos: ${(error as Error).message}`,
{ cause: error }
);
}
}
🤖 Prompt for AI Agents
In npm/runners/build-newsroom-videos-runner.ts around lines 10 to 15, the path
resolution uses currentDirPath which points to npm/config instead of the
repository root, and the error message incorrectly references "dashboard"
instead of "newsroom videos". Fix this by adjusting the path to correctly
resolve from the repository root to the config file, and update the error
message to accurately say "Error building newsroom videos". Also, ensure the
error is properly included in the thrown Error object.

}
}
26 changes: 26 additions & 0 deletions npm/runners/build-post-list-runner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { buildPostList } from '../scripts/build-post-list';
import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';

const currentFilePath = fileURLToPath(import.meta.url);
const currentDirPath = dirname(currentFilePath);
const projectRoot = resolve(currentDirPath, '../../');


export async function runBuildPostList() {
const postDirectories = [
[resolve(projectRoot, 'pages', 'blog'), '/blog'],
[resolve(projectRoot, 'pages', 'docs'), '/docs'],
[resolve(projectRoot, 'pages', 'about'), '/about']
];

const basePath = resolve(projectRoot, 'pages');
const writeFilePath = resolve(projectRoot, 'config', 'posts.json');

try {
await buildPostList(postDirectories, basePath, writeFilePath);
} catch (err) {
throw new Error('Error building post list: ', err as Error);
}

}
26 changes: 26 additions & 0 deletions npm/runners/build-tools-runner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { buildTools } from "../scripts/build-tools";

import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';
import { logger } from "../scripts/helpers/logger";

const currentFilePath = fileURLToPath(import.meta.url);
const currentDirPath = dirname(currentFilePath);

export async function runBuildTools() {
try {
const automatedToolsPath = resolve(currentDirPath, '../../config', 'tools-automated.json');
const manualToolsPath = resolve(currentDirPath, '../../config', 'tools-manual.json');
const toolsPath = resolve(currentDirPath, '../../config', 'tools.json');
const tagsPath = resolve(currentDirPath, '../../config', 'all-tags.json');

await buildTools(automatedToolsPath, manualToolsPath, toolsPath, tagsPath).catch((err) => {
logger.error('Failed to build tools:', err);
process.exit(1);
});
} catch (error) {
throw new Error('Error building tools: ', error as Error);
}
}


24 changes: 24 additions & 0 deletions npm/runners/case-studies-runner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { buildCaseStudiesList } from '../scripts/casestudies';
import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';
import fs from 'fs';

const currentFilePath = fileURLToPath(import.meta.url);
const currentDirPath = dirname(currentFilePath);
const projectRoot = resolve(currentDirPath, '../../');

export async function runCaseStudies() {
try {
const caseStudyDirectory = resolve(projectRoot, 'config', 'casestudies');

if (!fs.existsSync(caseStudyDirectory)) {
console.error(`Directory does not exist: ${caseStudyDirectory}`);
return;
}

const writeFilePath = resolve(projectRoot, 'config', 'casestudies.json');
await buildCaseStudiesList(caseStudyDirectory, writeFilePath);
} catch (error) {
throw new Error('Error building case studies: ', error as Error);
}
}
Loading
Loading